Metamath Proof Explorer


Table of Contents - 16.3. Walks, paths and cycles

A "walk" in a graph is usually defined for simple graphs, multigraphs or even pseudographs as "alternating sequence of vertices and edges x0 , e1 , x1 , e2 , ... , e(l) , x(l) where e(i) = x(i-1)x(i), 0Bollobas] p. 4, or "A walk (of length k) in a graph is a nonempty alternating sequence v0 e0 v1 e1 ... e(k-1) vk of vertices and edges in G such that ei = { vi , vi+1 } for all i < k.", see definition of [Diestel] p. 10.

Formalizing these definitions (mainly by representing the indexed vertices and edges by functions), a walk is represented by two mappings f from { 1 , ... , n } and p from { 0 , ... , n }, where f enumerates the (indices of the) edges (e is a third function enumerating the edges within the graph, not within the walk), and p enumerates the vertices, see df-wlks. Hence a walk (of length n) is represented by the following sequence:

p(0) e(f(1)) p(1) e(f(2)) ... p(n-1) e(f(n)) p(n).

Alternatively, one could define a walk as a function such that for all , and for all , and .

Based on our definition of , the class of all walks, more restrictive constructs are defined:

* (df-trls): A "walk is called a trail if all its edges are distinct.", see Definition of [Bollobas] p. 5, i.e., f(i) =/= f(j) if i =/= j.

* (df-pths): A path is a walk whose vertices except the first and the last vertex are distinct, i.e., p(i) =/= p(j) if i < j, except possibly when i = 0 and j = n.

* (simple paths, df-spths): A simple path"is a walk with distinct vertices.", see Notation of [Bollobas] p. 5, i.e., p(i) =/= p(j) if i =/= j.

* (closed walks, df-clwlks): A walk whose endvertices coincide is called a closed walk, i.e., p(0) = p(n).

* (df-crcts): "A trail whose endvertices coincide (a closed trail) is called a circuit." (see Definition of [Bollobas] p. 5), i.e., f(i) =/= f(j) if i =/= j and p(0) = p(n). Equivalently, a circuit is a closed walk with distinct edges.

* (df-cycls): A path whose endvertices coincide (a closed path) is called a cycle, i.e., p(i) =/= p(j) if i =/= j, except i = 0 and j = n, and p(0) = p(n). Equivalently, a cycle is a closed walk with distinct vertices.

* (Eulerian paths, df-eupth): An Eulerian path is "a trail containing all edges [of the graph]" (see definition in [Bollobas] p. 16), i.e., f(i) =/= f(j) if i =/= j and for all edges e(x) there is an 1 <= i <= n with e(x) = e(f(i)). Note, however, that an Eulerian path needs not be a path.

* Eulerian circuit: An Eulerian circuit (called Euler tour in the definition in [Diestel] p. 22) is "a circuit in a graph containing all the edges" (see definition in [Bollobas] p. 16), i.e., f(i) =/= f(j) if i =/= j, p(0) = p(n) and for all edges e(x) there is an 1 <= i <= n with e(x) = e(f(i)).

Hierarchy of all kinds of walks (apply ssriv and elopabran to the mentioned theorems to obtain the following subset relationships, as available for clwlkiswlk, see clwlkwlk and clwlkswks):

* Trails are walks (trliswlk):

* Paths are trails (pthistrl):

* Simple paths are paths (spthispth):

* Closed walks are walks (clwlkiswlk):

* Circuits are closed walks (crctisclwlk):

* Circuits are trails (crctistrl):

* Cycles are paths (cyclispth):

* Cycles are circuits (cycliscrct):

* (Non-trivial) cycles are not simple paths (cyclnspth):

* Eulerian paths are trails (eupthistrl):

Often, it is sufficient to refer to a walk by the natural sequence of its vertices, i.e., omitting its edges in its representation: p(0) p(1) ... p(n-1) p(n), see the corresponding remark in [Diestel] p. 6. The concept of a , see df-word, is the appropriate way to define such a sequence (being finite and starting at index 0) of vertices. Therefore, it is used in definition df-wwlks for , and the representation of a walk as sequence of its vertices is called "walk as word".

Only for simple pseudographs, however, the edges can be uniquely reconstructed from such a representation. In this case, the general definitions of walks and the definition of walks as words are equivalent, see wlkiswwlks. In other cases, there could be more than one edge between two adjacent vertices in the walk (in a multigraph), or two adjacent vertices could be connected by two different hyperedges involving additional vertices (in a hypergraph).

Based on this definition of , the class of all walks as word, more restrictive constructs are defined analogously to the general definition of a walk:

* (walks of length N as word, df-wwlksn): n = N

* (simple paths of length N as word, df-wspthsn): p(i) =/= p(j) if i =/= j and n = N

* (closed walks as word, df-clwwlk): p(0) = p(n)

* (closed walks of length N as word, df-clwwlkn): p(0) = p(n) and n = N

Finally, there are a couple of definitions for (special) walks having fixed endpoints and :

* Walks with particular endpoints (df-wlkson):

* Trails with particular endpoints (df-trlson):

* Paths with particular endpoints (df-pthson):

* Simple paths with particular endpoints (df-spthson):

* Walks of a fixed length as words with particular endpoints (df-wwlksnon):

* Simple paths of a fixed length as words with particular endpoints (df-wspthsnon):

* Closed Walks of a fixed length as words anchored at a particular vertex (df-wwlksnon):

  1. Walks
    1. cewlks
    2. cwlks
    3. cwlkson
    4. df-ewlks
    5. df-wlks
    6. df-wlkson
    7. ewlksfval
    8. isewlk
    9. ewlkprop
    10. ewlkinedg
    11. ewlkle
    12. upgrewlkle2
    13. wkslem1
    14. wkslem2
    15. wksfval
    16. iswlk
    17. wlkprop
    18. wlkv
    19. iswlkg
    20. wlkf
    21. wlkcl
    22. wlkp
    23. wlkpwrd
    24. wlklenvp1
    25. wksv
    26. wlkn0
    27. wlklenvm1
    28. ifpsnprss
    29. wlkvtxeledg
    30. wlkvtxiedg
    31. relwlk
    32. wlkvv
    33. wlkop
    34. wlkcpr
    35. wlk2f
    36. wlkcomp
    37. wlkcompim
    38. wlkelwrd
    39. wlkeq
    40. edginwlk
    41. upgredginwlk
    42. iedginwlk
    43. wlkl1loop
    44. wlk1walk
    45. wlk1ewlk
    46. upgriswlk
    47. upgrwlkedg
    48. upgrwlkcompim
    49. wlkvtxedg
    50. upgrwlkvtxedg
    51. uspgr2wlkeq
    52. uspgr2wlkeq2
    53. uspgr2wlkeqi
    54. umgrwlknloop
    55. wlkRes
    56. wlkv0
    57. g0wlk0
    58. 0wlk0
    59. wlk0prc
    60. wlklenvclwlk
    61. wlklenvclwlkOLD
    62. wlkson
    63. iswlkon
    64. wlkonprop
    65. wlkpvtx
    66. wlkepvtx
    67. wlkoniswlk
    68. wlkonwlk
    69. wlkonwlk1l
    70. wlksoneq1eq2
    71. wlkonl1iedg
    72. wlkon2n0
    73. 2wlklem
    74. upgr2wlk
    75. wlkreslem
    76. wlkres
    77. redwlklem
    78. redwlk
    79. wlkp1lem1
    80. wlkp1lem2
    81. wlkp1lem3
    82. wlkp1lem4
    83. wlkp1lem5
    84. wlkp1lem6
    85. wlkp1lem7
    86. wlkp1lem8
    87. wlkp1
    88. wlkdlem1
    89. wlkdlem2
    90. wlkdlem3
    91. wlkdlem4
    92. wlkd
  2. Walks for loop-free graphs
    1. lfgrwlkprop
    2. lfgriswlk
    3. lfgrwlknloop
  3. Trails
    1. ctrls
    2. ctrlson
    3. df-trls
    4. df-trlson
    5. reltrls
    6. trlsfval
    7. istrl
    8. trliswlk
    9. trlf1
    10. trlreslem
    11. trlres
    12. upgrtrls
    13. upgristrl
    14. upgrf1istrl
    15. wksonproplem
    16. trlsonfval
    17. istrlson
    18. trlsonprop
    19. trlsonistrl
    20. trlsonwlkon
    21. trlontrl
  4. Paths and simple paths
    1. cpths
    2. cspths
    3. cpthson
    4. cspthson
    5. df-pths
    6. df-spths
    7. df-pthson
    8. df-spthson
    9. relpths
    10. pthsfval
    11. spthsfval
    12. ispth
    13. isspth
    14. pthistrl
    15. spthispth
    16. pthiswlk
    17. spthiswlk
    18. pthdivtx
    19. pthdadjvtx
    20. 2pthnloop
    21. upgr2pthnlp
    22. spthdifv
    23. spthdep
    24. pthdepisspth
    25. upgrwlkdvdelem
    26. upgrwlkdvde
    27. upgrspthswlk
    28. upgrwlkdvspth
    29. pthsonfval
    30. spthson
    31. ispthson
    32. isspthson
    33. pthsonprop
    34. spthonprop
    35. pthonispth
    36. pthontrlon
    37. pthonpth
    38. isspthonpth
    39. spthonisspth
    40. spthonpthon
    41. spthonepeq
    42. uhgrwkspthlem1
    43. uhgrwkspthlem2
    44. uhgrwkspth
    45. usgr2wlkneq
    46. usgr2wlkspthlem1
    47. usgr2wlkspthlem2
    48. usgr2wlkspth
    49. usgr2trlncl
    50. usgr2trlspth
    51. usgr2pthspth
    52. usgr2pthlem
    53. usgr2pth
    54. usgr2pth0
    55. pthdlem1
    56. pthdlem2lem
    57. pthdlem2
    58. pthd
  5. Closed walks
    1. cclwlks
    2. df-clwlks
    3. clwlks
    4. isclwlk
    5. clwlkiswlk
    6. clwlkwlk
    7. clwlkswks
    8. isclwlke
    9. isclwlkupgr
    10. clwlkcomp
    11. clwlkcompim
    12. upgrclwlkcompim
    13. clwlkcompbp
    14. clwlkl1loop
  6. Circuits and cycles
    1. ccrcts
    2. ccycls
    3. df-crcts
    4. df-cycls
    5. crcts
    6. cycls
    7. iscrct
    8. iscycl
    9. crctprop
    10. cyclprop
    11. crctisclwlk
    12. crctistrl
    13. crctiswlk
    14. cyclispth
    15. cycliswlk
    16. cycliscrct
    17. cyclnspth
    18. cyclispthon
    19. lfgrn1cycl
    20. usgr2trlncrct
    21. umgrn1cycl
    22. uspgrn2crct
    23. usgrn2cycl
    24. crctcshwlkn0lem1
    25. crctcshwlkn0lem2
    26. crctcshwlkn0lem3
    27. crctcshwlkn0lem4
    28. crctcshwlkn0lem5
    29. crctcshwlkn0lem6
    30. crctcshwlkn0lem7
    31. crctcshlem1
    32. crctcshlem2
    33. crctcshlem3
    34. crctcshlem4
    35. crctcshwlkn0
    36. crctcshwlk
    37. crctcshtrl
    38. crctcsh
  7. Walks as words
    1. cwwlks
    2. cwwlksn
    3. cwwlksnon
    4. cwwspthsn
    5. cwwspthsnon
    6. df-wwlks
    7. df-wwlksn
    8. df-wwlksnon
    9. df-wspthsn
    10. df-wspthsnon
    11. wwlks
    12. iswwlks
    13. wwlksn
    14. iswwlksn
    15. wwlksnprcl
    16. iswwlksnx
    17. wwlkbp
    18. wwlknbp
    19. wwlknp
    20. wwlknbp1
    21. wwlknvtx
    22. wwlknllvtx
    23. wwlknlsw
    24. wspthsn
    25. iswspthn
    26. wspthnp
    27. wwlksnon
    28. wspthsnon
    29. iswwlksnon
    30. wwlksnon0
    31. wwlksonvtx
    32. iswspthsnon
    33. wwlknon
    34. wspthnon
    35. wspthnonp
    36. wspthneq1eq2
    37. wwlksn0s
    38. wwlkssswrd
    39. wwlksn0
    40. 0enwwlksnge1
    41. wwlkswwlksn
    42. wwlkssswwlksn
    43. wlkiswwlks1
    44. wlklnwwlkln1
    45. wlkiswwlks2lem1
    46. wlkiswwlks2lem2
    47. wlkiswwlks2lem3
    48. wlkiswwlks2lem4
    49. wlkiswwlks2lem5
    50. wlkiswwlks2lem6
    51. wlkiswwlks2
    52. wlkiswwlks
    53. wlkiswwlksupgr2
    54. wlkiswwlkupgr
    55. wlkswwlksf1o
    56. wlkswwlksen
    57. wwlksm1edg
    58. wlklnwwlkln2lem
    59. wlklnwwlkln2
    60. wlklnwwlkn
    61. wlklnwwlklnupgr2
    62. wlklnwwlknupgr
    63. wlknewwlksn
    64. wlknwwlksnbij
    65. wlknwwlksnen
    66. wlknwwlksneqs
    67. wwlkseq
    68. wwlksnred
    69. wwlksnext
    70. wwlksnextbi
    71. wwlksnredwwlkn
    72. wwlksnredwwlkn0
    73. wwlksnextwrd
    74. wwlksnextfun
    75. wwlksnextinj
    76. wwlksnextsurj
    77. wwlksnextbij0
    78. wwlksnextbij
    79. wwlksnexthasheq
    80. disjxwwlksn
    81. wwlksnndef
    82. wwlksnfi
    83. wwlksnfiOLD
    84. wlksnfi
    85. wlksnwwlknvbij
    86. wwlksnextproplem1
    87. wwlksnextproplem2
    88. wwlksnextproplem3
    89. wwlksnextprop
    90. disjxwwlkn
    91. hashwwlksnext
    92. wwlksnwwlksnon
    93. wspthsnwspthsnon
    94. wspthsnonn0vne
    95. wspthsswwlkn
    96. wspthnfi
    97. wwlksnonfi
    98. wspthsswwlknon
    99. wspthnonfi
    100. wspniunwspnon
    101. wspn0
  8. Walks/paths of length 2 (as length 3 strings)
    1. 2wlkdlem1
    2. 2wlkdlem2
    3. 2wlkdlem3
    4. 2wlkdlem4
    5. 2wlkdlem5
    6. 2pthdlem1
    7. 2wlkdlem6
    8. 2wlkdlem7
    9. 2wlkdlem8
    10. 2wlkdlem9
    11. 2wlkdlem10
    12. 2wlkd
    13. 2wlkond
    14. 2trld
    15. 2trlond
    16. 2pthd
    17. 2spthd
    18. 2pthond
    19. 2pthon3v
    20. umgr2adedgwlklem
    21. umgr2adedgwlk
    22. umgr2adedgwlkon
    23. umgr2adedgwlkonALT
    24. umgr2adedgspth
    25. umgr2wlk
    26. umgr2wlkon
    27. elwwlks2s3
    28. midwwlks2s3
    29. wwlks2onv
    30. elwwlks2ons3im
    31. elwwlks2ons3
    32. s3wwlks2on
    33. umgrwwlks2on
    34. wwlks2onsym
    35. elwwlks2on
    36. elwspths2on
    37. wpthswwlks2on
    38. 2wspdisj
    39. 2wspiundisj
    40. usgr2wspthons3
    41. usgr2wspthon
    42. elwwlks2
    43. elwspths2spth
  9. Walks in regular graphs
    1. rusgrnumwwlkl1
    2. rusgrnumwwlkslem
    3. rusgrnumwwlklem
    4. rusgrnumwwlkb0
    5. rusgrnumwwlkb1
    6. rusgr0edg
    7. rusgrnumwwlks
    8. rusgrnumwwlk
    9. rusgrnumwwlkg
    10. rusgrnumwlkg
    11. clwwlknclwwlkdif
    12. clwwlknclwwlkdifnum
  10. Closed walks as words
    1. Closed walks as words
    2. Closed walks of a fixed length as words
    3. Closed walks on a vertex of a fixed length as words
  11. Examples for walks, trails and paths
    1. 0ewlk
    2. 1ewlk
    3. 0wlk
    4. is0wlk
    5. 0wlkonlem1
    6. 0wlkonlem2
    7. 0wlkon
    8. 0wlkons1
    9. 0trl
    10. is0trl
    11. 0trlon
    12. 0pth
    13. 0spth
    14. 0pthon
    15. 0pthon1
    16. 0pthonv
    17. 0clwlk
    18. 0clwlkv
    19. 0clwlk0
    20. 0crct
    21. 0cycl
    22. 1pthdlem1
    23. 1pthdlem2
    24. 1wlkdlem1
    25. 1wlkdlem2
    26. 1wlkdlem3
    27. 1wlkdlem4
    28. 1wlkd
    29. 1trld
    30. 1pthd
    31. 1pthond
    32. upgr1wlkdlem1
    33. upgr1wlkdlem2
    34. upgr1wlkd
    35. upgr1trld
    36. upgr1pthd
    37. upgr1pthond
    38. lppthon
    39. lp1cycl
    40. 1pthon2v
    41. 1pthon2ve
    42. wlk2v2elem1
    43. wlk2v2elem2
    44. wlk2v2e
    45. ntrl2v2e
    46. 3wlkdlem1
    47. 3wlkdlem2
    48. 3wlkdlem3
    49. 3wlkdlem4
    50. 3wlkdlem5
    51. 3pthdlem1
    52. 3wlkdlem6
    53. 3wlkdlem7
    54. 3wlkdlem8
    55. 3wlkdlem9
    56. 3wlkdlem10
    57. 3wlkd
    58. 3wlkond
    59. 3trld
    60. 3trlond
    61. 3pthd
    62. 3pthond
    63. 3spthd
    64. 3spthond
    65. 3cycld
    66. 3cyclpd
    67. upgr3v3e3cycl
    68. uhgr3cyclexlem
    69. uhgr3cyclex
    70. umgr3cyclex
    71. umgr3v3e3cycl
    72. upgr4cycl4dv4e
  12. Connected graphs
    1. cconngr
    2. df-conngr
    3. dfconngr1
    4. isconngr
    5. isconngr1
    6. cusconngr
    7. 0conngr
    8. 0vconngr
    9. 1conngr
    10. conngrv2edg
    11. vdn0conngrumgrv2