Macaulay2 » Documentation
Packages » Graphs :: underlyingGraph
next | previous | forward | backward | up | index | toc

underlyingGraph -- Returns the underlying graph of a digraph

Synopsis

Description

The underlying graph of a digraph is the simple graph constructed by all edges {u,v} such that (u,v) or (v,u) is a directed edge in the digraph.

i1 : D = digraph hashTable{1 => {2,3}, 2 => {1,3}, 3 => {}};
i2 : underlyingGraph D

o2 = Graph{1 => {2, 3}}
           2 => {1, 3}
           3 => {1, 2}

o2 : Graph

Ways to use underlyingGraph :

For the programmer

The object underlyingGraph is a method function.