Skip to Main Content
Exploring Graphs with Elixir
book

Exploring Graphs with Elixir

by Tony Hammond
November 2022
Intermediate to advanced content levelIntermediate to advanced
294 pages
5h 58m
English
Pragmatic Bookshelf
Content preview from Exploring Graphs with Elixir

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, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Concurrent Data Processing in Elixir

Concurrent Data Processing in Elixir

Svilen Gospodinov

Publisher Resources

ISBN: 9798888650059Errata Page