Undirected edges. The
hash function are invariant under permutation of the vertices in the pair encoding the edge.
adjacency_matrix g computes the adjacency matrix of
g as well as a bijection between the matrix dimensions and the vertices. The matrix is dense. Since the graph is undirected, it is also symmetric.
laplacian g computes the laplacian of the adjacency matrix, following the definition in 'Spectral Graph Theory', by Fan Chung Graham. The dimensions are the same as the adjacency matrix. A finite bijection is returned as well.
Floyd-warshall algorithm. Complexity is O(V^3) where V is the number of vertices of the graph. Returns a table of all distances between pairs of vertices.
Computes the diameter of the graph, ie the maximum over all pair of vertices of the shortest-path distance between those vertices.
val volume : t -> int
volume g computes the sum over all vertices of their degree.