Unix lineage¶

One of the stock examples of graphviz is the Unix lineage. In this notebook we'll be visualizing that graph using DAGVIZ.

Construct the graph¶

In [1]:
import networkx as nx
from dagviz import Dagre, Metro
In [2]:
u = nx.DiGraph()
u.add_edge('5th Edition', '6th Edition')
u.add_edge('5th Edition', 'PWB 1.0')
u.add_edge('6th Edition', 'LSX')
u.add_edge('6th Edition', '1 BSD')
u.add_edge('6th Edition', 'Mini Unix')
u.add_edge('6th Edition', 'Wollongong')
u.add_edge('6th Edition', 'Interdata')
u.add_edge('Interdata', 'Unix/TS 3.0')
u.add_edge('Interdata', 'PWB 2.0')
u.add_edge('Interdata', '7th Edition')
u.add_edge('7th Edition', '8th Edition')
u.add_edge('7th Edition', '32V')
u.add_edge('7th Edition', 'V7M')
u.add_edge('7th Edition', 'Ultrix-11')
u.add_edge('7th Edition', 'Xenix')
u.add_edge('7th Edition', 'UniPlus+')
u.add_edge('V7M', 'Ultrix-11')
u.add_edge('8th Edition', '9th Edition')
u.add_edge('1 BSD', '2 BSD')
u.add_edge('2 BSD', '2.8 BSD')
u.add_edge('2.8 BSD', 'Ultrix-11')
u.add_edge('2.8 BSD', '2.9 BSD')
u.add_edge('32V', '3 BSD')
u.add_edge('3 BSD', '4 BSD')
u.add_edge('4 BSD', '4.1 BSD')
u.add_edge('4.1 BSD', '4.2 BSD')
u.add_edge('4.1 BSD', '2.8 BSD')
u.add_edge('4.1 BSD', '8th Edition')
u.add_edge('4.2 BSD', '4.3 BSD')
u.add_edge('4.2 BSD', 'Ultrix-32')
u.add_edge('PWB 1.0', 'PWB 1.2')
u.add_edge('PWB 1.0', 'USG 1.0')
u.add_edge('PWB 1.2', 'PWB 2.0')
u.add_edge('USG 1.0', 'CB Unix 1')
u.add_edge('USG 1.0', 'USG 2.0')
u.add_edge('CB Unix 1', 'CB Unix 2')
u.add_edge('CB Unix 2', 'CB Unix 3')
u.add_edge('CB Unix 3', 'Unix/TS++')
u.add_edge('CB Unix 3', 'PDP-11 Sys V')
u.add_edge('USG 2.0', 'USG 3.0')
u.add_edge('USG 3.0', 'Unix/TS 3.0')
u.add_edge('PWB 2.0', 'Unix/TS 3.0')
u.add_edge('Unix/TS 1.0', 'Unix/TS 3.0')
u.add_edge('Unix/TS 3.0', 'TS 4.0')
u.add_edge('Unix/TS++', 'TS 4.0')
u.add_edge('CB Unix 3', 'TS 4.0')
u.add_edge('TS 4.0', 'System V.0')
u.add_edge('System V.0', 'System V.2')
u.add_edge('System V.2', 'System V.3')

Visualize with Dagre¶

In [3]:
Dagre(u)
Out[3]:

Visualize with Metro¶

In [4]:
Metro(u)
Out[4]:
5th EditionUnix/TS 1.06th EditionPWB 1.0LSX1 BSDMini UnixWollongongInterdataPWB 1.2USG 1.02 BSD7th EditionPWB 2.0CB Unix 1USG 2.032VV7MXenixUniPlus+CB Unix 2USG 3.03 BSDCB Unix 3Unix/TS 3.04 BSDUnix/TS++PDP-11 Sys V4.1 BSDTS 4.04.2 BSD2.8 BSD8th EditionSystem V.04.3 BSDUltrix-32Ultrix-112.9 BSD9th EditionSystem V.2System V.3
In [ ]: