isSimple -- checks if a graph is simple

Synopsis

• Usage:
r = isSimple G
• Inputs:
• G, an instance of the type Graph,
• Outputs:
• r, ,

Description

A graph is said to be simple if it has a maximum of one edge between each vertex, contains no loops (vertices connected to themselves by edges), and is undirected. Since the Graph Type does not allow for multiple edges and directed edges, it is sufficient to check that the graph has no loops.

 i1 : G = cycleGraph 5; i2 : isSimple G o2 = true i3 : G' = addEdge (G, set {1,1}); i4 : isSimple G' o4 = false

Ways to use isSimple :

• "isSimple(Graph)"

For the programmer

The object isSimple is .