Finally, there are several invariants of graphs which are of particular interest because of the algorithms that compute them.
The shortestpath spanning tree of a grid graph is defined in terms of Manhattan distance, where the distance between points with coordinates and is .
ShowGraph[
ShortestPathSpanningTree[
GridGraph[5,5],1] ];
In an unweighted graph there can be many different shortest paths between any pair of vertices. This path between two opposing corners goes all the way to the right, then all the way to the top.
ShortestPath[GridGraph[5,5],1,25]
A minimum spanning tree of a weighted graph is a set of edges of minimum total weight which form a spanning tree of the graph. Any spanning tree is a minimum spanning tree when the graphs are unweighted.
ShowGraph[ MinimumSpanningTree[ CompleteGraph[6,6,6] ] ];
The number of spanning trees of a complete graph is , as was proved by Cayley.
NumberOfSpanningTrees[CompleteGraph[10]]
The maximum flow through an unweighted complete bipartite graph is the minimum degree .
NetworkFlow[ CompleteGraph[4,4], 1, 8]
A matching in a graph is a set of edges of such that no two of them share a vertex in common. A perfect matching of an even cycle consists of alternating edges in the cycle.
BipartiteMatching[ Cycle[8] ]
Any maximal matching of a is a maximum matching, and perfect if is even.
MaximalMatching[CompleteGraph[8]]
Planar graphs are graphs which can be embedded in the plane with no pair of edges crossing. and are the basic nonplanar graphs.
PlanarQ[CompleteGraph[5]] || PlanarQ[CompleteGraph[3,3]]
Every planar graph on nine vertices has a nonplanar complement.
PlanarQ[ GraphComplement[GridGraph[3,3]] ]
Combinatorica functions for algorithmic graph theory.