Documentation

FormalConjecturesForMathlib.Combinatorics.SimpleGraph.VertexDistance

noncomputable def SimpleGraph.distToSet {α : Type u_1} [Fintype α] (G : SimpleGraph α) (v : α) (S : Set α) :

Distance from a vertex to a finite set.

Equations
Instances For
    noncomputable def SimpleGraph.averageDistance {α : Type u_1} [Fintype α] (G : SimpleGraph α) :

    Average distance of G.

    Equations
    Instances For
      def SimpleGraph.isInducedPath {α : Type u_1} (G : SimpleGraph α) (l : List α) :

      Check if a list of vertices forms an induced path in G.

      Equations
      Instances For
        noncomputable def SimpleGraph.path {α : Type u_1} [Fintype α] [DecidableEq α] (G : SimpleGraph α) :

        The path number of a graph: The number of vertices of a largest induced path of the graph.

        Equations
        Instances For
          noncomputable def SimpleGraph.ecc {α : Type u_1} [Fintype α] (G : SimpleGraph α) (S : Set α) :

          Auxiliary quantity ecc used in conjecture 34.

          Equations
          Instances For
            noncomputable def SimpleGraph.distMin {α : Type u_1} [Fintype α] (G : SimpleGraph α) (S : Set α) :

            The minimum, over all vertices $v \notin S$, of the distance from $v$ to the set $S$: $\min_{v \notin S} \operatorname{dist}(v, S)$. Returns 0 when $S = \mathrm{univ}$ (no vertex outside $S$).

            Counterpart to ecc: the outer minimum (instead of maximum) of the distance-to-set function, restricted to vertices outside $S$.

            Equations
            Instances For
              noncomputable def SimpleGraph.eccSet {α : Type u_1} [Fintype α] (G : SimpleGraph α) (S : Set α) :

              The eccentricity of a set S: the maximum, over all vertices v of G, of the minimum distance from v to any vertex in S. (This includes vertices in S itself, which contribute distance 0.) Returns 0 when S is empty.

              Unlike ecc, which restricts the outer maximum to vertices v ∉ S, eccSet does not exclude any vertex; it is the conventional definition of "set eccentricity" used in DeLaVina's WOWII conjectures 18, 145 and 146.

              Equations
              Instances For
                noncomputable def SimpleGraph.distavg {α : Type u_1} [Fintype α] (G : SimpleGraph α) (S : Set α) :

                Average distance from all vertices to a given set.

                Equations
                Instances For

                  The square of a graph G, denoted : two distinct vertices are adjacent iff their distance in G is at most 2.

                  Equations
                  Instances For
                    noncomputable def SimpleGraph.isInducedC4 {α : Type u_1} (G : SimpleGraph α) [DecidableRel G.Adj] (a b c d : α) :

                    Check whether four distinct vertices form an induced 4-cycle in G. We test all three perfect-matching pairings of the four vertices to find a cyclic ordering and verify that the induced subgraph has exactly those 4 edges.

                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For
                      noncomputable def SimpleGraph.countInducedC4 {α : Type u_1} [Fintype α] [DecidableEq α] (G : SimpleGraph α) [DecidableRel G.Adj] :

                      Count of induced C₄ subgraphs of G. We count ordered 4-tuples (a,b,c,d) of distinct vertices for which isInducedC4 G a b c d = true, then divide by 24 = 4!.

                      Why 24 (and not 8)? isInducedC4 tests all three perfect-matching pairings of the four vertices, so any of the 4! = 24 orderings of a fixed unordered induced 4-cycle satisfies the predicate. Dividing by 8 (the size of the dihedral group D₄) would overcount each induced 4-cycle by a factor of 3 — once for each of the three cyclic structures isInducedC4 accepts.

                      Equations
                      Instances For
                        def SimpleGraph.bfs_expand {α : Type u_1} [Fintype α] [DecidableEq α] (G : SimpleGraph α) [DecidableRel G.Adj] (S : Finset α) :

                        BFS expansion: add all neighbors of S to S.

                        Equations
                        Instances For
                          def SimpleGraph.bfs_dist_aux {α : Type u_1} [DecidableEq α] [Fintype α] (G : SimpleGraph α) [DecidableRel G.Adj] (target : α) :
                          Finset α
                          Equations
                          Instances For
                            def SimpleGraph.computable_dist {α : Type u_1} [Fintype α] [DecidableEq α] (G : SimpleGraph α) [DecidableRel G.Adj] (u v : α) :

                            Computable graph distance via BFS. Returns 0 if u = v or if v is unreachable from u.

                            Equations
                            Instances For

                              Computable average distance as a rational.

                              Equations
                              Instances For
                                theorem SimpleGraph.dist_eq_computable {α : Type u_1} [Fintype α] [DecidableEq α] (G : SimpleGraph α) [DecidableRel G.Adj] (u v : α) :
                                G.dist u v = G.computable_dist u v
                                noncomputable def SimpleGraph.evenDistancePairs {α : Type u_1} [Fintype α] (G : SimpleGraph α) :
                                Finset (α × α)

                                The set of pairs of distinct vertices with even distance > 0.

                                Equations
                                Instances For
                                  noncomputable def SimpleGraph.minEvenDistance {α : Type u_1} [Fintype α] (G : SimpleGraph α) :

                                  Minimum even distance between distinct vertices in G. Only positive even distances are considered. Returns 0 if no such distance exists.

                                  Equations
                                  Instances For
                                    noncomputable def SimpleGraph.maxEvenDistance {α : Type u_1} [Fintype α] (G : SimpleGraph α) :

                                    Maximum even distance between distinct vertices in G. Only positive even distances are considered. Returns 0 if no such distance exists.

                                    Equations
                                    Instances For
                                      noncomputable def SimpleGraph.averageEvenDistance {α : Type u_1} [Fintype α] (G : SimpleGraph α) :

                                      Average even distance between distinct vertices in G. Only positive even distances are considered. Returns 0 if no such distance exists.

                                      Equations
                                      Instances For