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

mixedGraph -- The function that creates a mixed graph.

Synopsis

Description

A mixed graph is stored as a HashTable whose keys are the types Graph, Digraph, and Bigraph. The values are the corresponding graphs. The order of the input matters. An error is issued if the first argument is not a graph, the second a Digraph and the third a Bigraph.
i1 : D = digraph({{a, {b,c}}, {b,{d,e}}, {c, {e,h}}, {d, {f}}, {e, {f,g}},
         {f, {}}, {g, {}}, {h, {}}})

o1 = Digraph{a => set {b, c}}
             b => set {d, e}
             c => set {e, h}
             d => set {f}
             e => set {f, g}
             f => set {}
             g => set {}
             h => set {}

o1 : Digraph
i2 : G = graph({{a,b},{c,d},{a,c},{d,h},{b,h}})

o2 = Graph{a => set {b, c}}
           b => set {a, h}
           c => set {a, d}
           d => set {c, h}
           h => set {b, d}

o2 : Graph
i3 : B = bigraph({{c,d},{e,f}})

o3 = Bigraph{c => set {d}}
             d => set {c}
             e => set {f}
             f => set {e}

o3 : Bigraph
i4 : H = mixedGraph(G,D,B)

o4 = MixedGraph{Bigraph => Bigraph{c => set {d}}   }
                                   d => set {c}
                                   e => set {f}
                                   f => set {e}
                Digraph => Digraph{a => set {b, c}}
                                   b => set {d, e}
                                   c => set {e, h}
                                   d => set {f}
                                   e => set {f, g}
                                   f => set {}
                                   g => set {}
                                   h => set {}
                Graph => Graph{a => set {b, c}}
                               b => set {a, h}
                               c => set {a, d}
                               d => set {c, h}
                               h => set {b, d}

o4 : MixedGraph

Ways to use mixedGraph :