Graph metric #
This module defines the SimpleGraph.edist function, which takes pairs of vertices to the length of
the shortest walk between them, or ⊤ if they are disconnected. It also defines SimpleGraph.dist
which is the ℕ-valued version of SimpleGraph.edist.
Main definitions #
SimpleGraph.edistis the graph extended metric.SimpleGraph.distis the graph metric.
TODO #
Provide an additional computable version of
SimpleGraph.distfor whenGis connected.When directed graphs exist, a directed notion of distance, likely
ENat-valued.
Tags #
graph metric, distance
Metric #
The extended distance between two vertices is the length of the shortest walk between them.
It is ⊤ if no such walk exists.
Instances For
Alias of SimpleGraph.edist_le.
The extended distance between vertices is equal to 1 if and only if these vertices are adjacent.
Supergraphs have smaller or equal extended distances to their subgraphs.
The distance between two vertices is the length of the shortest walk between them.
If no such walk exists, this uses the junk value of 0.
Instances For
The distance between vertices is equal to 1 if and only if these vertices are adjacent.
Supergraphs have smaller or equal distances to their subgraphs.
This bundles and abstracts some facts about the first three vertices of a shortest walk of length at least two: the first and third nodes are different and not connected.