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

isSimple -- checks if a graph is simple



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 :

For the programmer

The object isSimple is a method function.