标签:style io ar os sp for on art bs
In graph theory, a Eulerian trail (or Eulerian path) is a trail in a graph which visits every edge exactly once. Similarly, an Eulerian circuit or Eulerian cycle is an Eulerian trail which starts and ends on the same vertex.
Hierholzer‘s algorithm 可以在O(E)的时间下给出解。
算法:
当然,需要用到双向链表不断地把边删掉,如果最终所有边都被访问了,那么就可以退出了。但是如果找不到点继续扩展,而且边又还有的话,那么就说明给不出回路。
标签:style io ar os sp for on art bs
原文地址:http://www.cnblogs.com/linyx/p/4082227.html