Metamath Proof Explorer


Table of Contents - 17.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. wksvOLD
    27. wlkn0
    28. wlklenvm1
    29. ifpsnprss
    30. wlkvtxeledg
    31. wlkvtxiedg
    32. relwlk
    33. wlkvv
    34. wlkop
    35. wlkcpr
    36. wlk2f
    37. wlkcomp
    38. wlkcompim
    39. wlkelwrd
    40. wlkeq
    41. edginwlk
    42. upgredginwlk
    43. iedginwlk
    44. wlkl1loop
    45. wlk1walk
    46. wlk1ewlk
    47. upgriswlk
    48. upgrwlkedg
    49. upgrwlkcompim
    50. wlkvtxedg
    51. upgrwlkvtxedg
    52. uspgr2wlkeq
    53. uspgr2wlkeq2
    54. uspgr2wlkeqi
    55. umgrwlknloop
    56. wlkResOLD
    57. wlkv0
    58. g0wlk0
    59. 0wlk0
    60. wlk0prc
    61. wlklenvclwlk
    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. wksonproplemOLD
    17. trlsonfval
    18. istrlson
    19. trlsonprop
    20. trlsonistrl
    21. trlsonwlkon
    22. 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. dfpth2
    21. pthdifv
    22. 2pthnloop
    23. upgr2pthnlp
    24. spthdifv
    25. spthdep
    26. pthdepisspth
    27. upgrwlkdvdelem
    28. upgrwlkdvde
    29. upgrspthswlk
    30. upgrwlkdvspth
    31. pthsonfval
    32. spthson
    33. ispthson
    34. isspthson
    35. pthsonprop
    36. spthonprop
    37. pthonispth
    38. pthontrlon
    39. pthonpth
    40. isspthonpth
    41. spthonisspth
    42. spthonpthon
    43. spthonepeq
    44. uhgrwkspthlem1
    45. uhgrwkspthlem2
    46. uhgrwkspth
    47. usgr2wlkneq
    48. usgr2wlkspthlem1
    49. usgr2wlkspthlem2
    50. usgr2wlkspth
    51. usgr2trlncl
    52. usgr2trlspth
    53. usgr2pthspth
    54. usgr2pthlem
    55. usgr2pth
    56. usgr2pth0
    57. pthdlem1
    58. pthdlem2lem
    59. pthdlem2
    60. 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. cyclnumvtx
    18. cyclnspth
    19. pthisspthorcycl
    20. pthspthcyc
    21. cyclispthon
    22. lfgrn1cycl
    23. usgr2trlncrct
    24. umgrn1cycl
    25. uspgrn2crct
    26. usgrn2cycl
    27. crctcshwlkn0lem1
    28. crctcshwlkn0lem2
    29. crctcshwlkn0lem3
    30. crctcshwlkn0lem4
    31. crctcshwlkn0lem5
    32. crctcshwlkn0lem6
    33. crctcshwlkn0lem7
    34. crctcshlem1
    35. crctcshlem2
    36. crctcshlem3
    37. crctcshlem4
    38. crctcshwlkn0
    39. crctcshwlk
    40. crctcshtrl
    41. 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. wlksnfi
    84. wlksnwwlknvbij
    85. wwlksnextproplem1
    86. wwlksnextproplem2
    87. wwlksnextproplem3
    88. wwlksnextprop
    89. disjxwwlkn
    90. hashwwlksnext
    91. wwlksnwwlksnon
    92. wspthsnwspthsnon
    93. wspthsnonn0vne
    94. wspthsswwlkn
    95. wspthnfi
    96. wwlksnonfi
    97. wspthsswwlknon
    98. wspthnonfi
    99. wspniunwspnon
    100. 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