next | previous | forward | backward | up | top | index | toc | Macaulay2 web site

DirectedGraph -- a class for directed graphs

Description

This class is a type of HashTable which represents directed graphs. It consists of a vertex set and a set of sequences (a,b) representing a directed edge from a to b.
i1 : V = {a,b,c,d,e}; -- the vertex set
i2 : E = {(a,b),(b,c),(a,c),(a,d),(d,e)}; -- directed edges; (a,b) means a directed edge from a to b.
i3 : G = directedGraph(V,E)

o3 = DirectedGraph{cache => CacheTable                                      }
                   DirectedEdges => {(a, b), (b, c), (a, c), (a, d), (d, e)}
                   Vertices => {a, b, c, d, e}

o3 : DirectedGraph
i4 : allPairsShortestPath(G)

o4 = | 0        1        1        1        2        |
     | infinity 0        1        infinity infinity |
     | infinity infinity 0        infinity infinity |
     | infinity infinity infinity 0        1        |
     | infinity infinity infinity infinity 0        |

                5          5
o4 : Matrix RR    <--- RR
              53         53

See also

Methods that use an object of class DirectedGraph :

For the programmer

The object DirectedGraph is a type, with ancestor classes HashTable < Thing.