Simulating a Network

Let’s get an example NativeGraph graph.

We previously stored an example of the early ARPANET—see Rendering with OmniGraffle. This would make a good candidate.

Although ARPANET may not have been built specifically to survive a nuclear attack, it was still designed to be resilient in the event of network losses and to reroute traffic as required. This small simulation here will aim to demonstrate a similar survivability of a network against inflicted outages.

Let’s start off with this small ARPANET graph:

 iex>​​ ​​arpa​​ ​​=​​ ​​NativeGraph.Examples.Arpa.arpa
 #Graph<type: undirected, vertices: [:sri, :ucla, :ucsb, :utah, :sri_h1,
  :ucla_h1, :ucsb_h1, :utah_h1], edges: [:sri <-> :ucla, :sri <-> :ucsb, :sri
  <-> :utah, ...

Get Exploring Graphs with Elixir now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.