Counting walks of a given length #
Main definitions #
walkLengthTwoEquivCommonNeighbors: bijective correspondence between walks of length two fromutovand common neighbours ofuandv. Note thatuandvmay be the same.finsetWalkLength: theFinsetof length-nwalks fromutov. This is used to give{p : G.walk u v | p.length = n}aFintypeinstance, and it can also be useful as a recursive description of this set whenVis finite.
TODO: should this be extended further?
Alias of SimpleGraph.Walk.setOf_length_eq_add_one.
Walks of length two from u to v correspond bijectively to common neighbours of u and v.
Note that u and v may be the same.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The Finset of length-n walks from u to v.
This is used to give {p : G.walk u v | p.length = n} a Fintype instance, and it
can also be useful as a recursive description of this set when V is finite.
See SimpleGraph.coe_finsetWalkLength_eq for the relationship between this Finset and
the set of length-n walks.
Equations
- One or more equations did not get rendered due to their size.
- G.finsetWalkLength 0 u v = if h : u = v then ⋯ ▸ {SimpleGraph.Walk.nil} else ∅
Instances For
The Finset of walks from u to v with length less than n. See finsetWalkLength for
context. In particular, we use this definition for SimpleGraph.Path.instFintype.
Equations
- G.finsetWalkLengthLT n u v = (Finset.range n).disjiUnion (fun (l : ℕ) => G.finsetWalkLength l u v) ⋯
Instances For
Equations
- G.fintypeSetWalkLength u v n = Fintype.ofFinset (G.finsetWalkLength n u v) ⋯
Equations
- G.fintypeSubtypeWalkLength u v n = { elems := SimpleGraph.fintypeSubtypeWalkLength._aux_1 G u v n, complete := ⋯ }
See SimpleGraph.adjMatrix_pow_apply_eq_card_walk for the cardinality in terms of the nth
power of the adjacency matrix.
Equations
- G.fintypeSetWalkLengthLT u v n = Fintype.ofFinset (G.finsetWalkLengthLT n u v) ⋯
Equations
- G.fintypeSubtypeWalkLengthLT u v n = { elems := SimpleGraph.fintypeSubtypeWalkLengthLT._aux_1 G u v n, complete := ⋯ }
Equations
- G.fintypeSetPathLength u v n = Fintype.ofFinset ({w ∈ G.finsetWalkLength n u v | w.IsPath}) ⋯
Equations
- G.fintypeSubtypePathLength u v n = { elems := SimpleGraph.fintypeSubtypePathLength._aux_1 G u v n, complete := ⋯ }
Equations
- G.fintypeSetPathLengthLT u v n = Fintype.ofFinset ({w ∈ G.finsetWalkLengthLT n u v | w.IsPath}) ⋯
Equations
- G.fintypeSubtypePathLengthLT u v n = { elems := SimpleGraph.fintypeSubtypePathLengthLT._aux_1 G u v n, complete := ⋯ }
Equations
- One or more equations did not get rendered due to their size.