Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > 7ebd25ac536d248d499a3ce2acda963a > files > 5848

Macaulay2-1.3.1-8.fc15.i686.rpm

-- -*- M2-comint -*- {* hash: -1588918960 *}

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

i5 :