interval_graph(intervals)
In graph theory, an interval graph is an undirected graph formed from a set of closed intervals on the real line, with a vertex for each interval and an edge between vertices whose intervals intersect. It is the intersection graph of the intervals.
More information can be found at: https://en.wikipedia.org/wiki/Interval_graph
if :None:None:`intervals`
contains None or an element which is not collections.abc.Sequence or not a length of 2.
if :None:None:`intervals`
contains an interval such that min1 > max1 where min1,max1 = interval
Generates an interval graph for a list of intervals given.
>>> intervals = [(-2, 3), [1, 4], (2, 3), (4, 6)]See :
... G = nx.interval_graph(intervals)
... sorted(G.edges) [((-2, 3), (1, 4)), ((-2, 3), (2, 3)), ((1, 4), (2, 3)), ((1, 4), (4, 6))]
The following pages refer to to this document either explicitly or contain code examples using this.
networkx.generators.interval_graph.interval_graph
Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.
Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)
SVG is more flexible but power hungry; and does not scale well to 50 + nodes.
All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them