Eularian Path
来源:互联网 发布:金兰软件怎么样 编辑:程序博客网 时间:2024/05/22 00:21
For Eulerian graph, every edge is visited exactly once.
Eulerian graph, the number of odd degree edge is either 0 or 2.
Eulerian circuit, all vertex's degree are even.
Algorithm for finding a Eulerian circuit.
Start with an empty stack and an empty circuit (eulerian path).
If all vertices have even degree: choose any of them. This will be the current vertex.
If there are exactly 2 vertices having an odd degree: choose one of them. This will be the current vertex.
Otherwise no Euler circuit or path exists.
Repeat step 2 until the current vertex has no more neighbors and the stack is empty.
If current vertex has no neighbors:
Add it to circuit,
Remove the last vertex from the stack and set it as the current one.
Otherwise:
Add the vertex to the stack,
Take any of its neighbors, remove the edge between selected neighbor and that vertex, and set that neighbor as the current vertex.
ref: http://stackoverflow.com/questions/17467228/looking-for-algorithm-finding-euler-path
Hamiltonian graph.
Every vertex is visited exactly once.
- Eularian Path
- path
- path
- path
- path
- path:
- path
- “path”,
- PATH
- PATH
- PATH
- path
- path
- path
- PATH
- $PATH
- path
- Path
- 153. Find Minimum in Rotated Sorted Array
- 总结一下学习vb串口通信的初期果实
- 扩展LDBSCAN 算法在图上的应用
- wamp+win10: php连接Mysql, delete update insert 详细操作步骤
- Leetcode 332. Reconstruct Itinerary
- Eularian Path
- 火星人的真实故事,读后感言
- 计算机图形学-初入门(小作品)
- 【LeetCode】 075. Sort Colors
- 还要和师兄混
- mmw mimo系统预编码
- 7107小时时,加入创业公司(没有股份,当作经验吧)
- [Leetcode] 63. Unique Paths II 解题报告
- 你不知道的“虚假需求”