next | previous | forward | backward | up | top | index | toc | Macaulay2 website
Graphs :: underlyingGraph

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.