# underlyingGraph -- Returns the underlying graph of a digraph

## Synopsis

• Usage:
G = underlyingGraph D
• Inputs:
• D, an instance of the type Digraph,
• Outputs:
• G, an instance of the type Graph, The underlying graph of digraph D

## 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 :

• "underlyingGraph(Digraph)"

## For the programmer

The object underlyingGraph is .