您的位置:首页 > 产品设计 > UI/UE

【资料】Fluery's Algorithm( 用于查找Euler path 和Euler circuit)

2014-01-11 19:42 225 查看
复习discrete math 看了老师的课件感觉不靠普,在百度上也找不到好的科普贴,

只能从国外的网站上扒下来生肉,看英文贴还是挺舒服的= =

所以直接:点击打开链接

Introduction

Euler's Theorems are examples of existence theorems
existence theorems tell whether or not something exists (e.g. Eulercircuit)
but doesn't tell us how to create it!
we want a constructive method for finding Euler paths and circuits
methods (well-defined procedures, recipes) for construction are calledalgorithms
there is an algorithm for constructing an Euler circuit: Fleury'salgorithm
we will illustrate it with the graph:



Fleury'sAlgorithm

1. pick any vertex to start

2. from that vertex pick an edge to traverse (see below for importantrule)

3. darken that edge, as a reminder that you can't traverse itagain

4. travel that edge, coming to the next vertex

5. repeat 2-4 until all edges have been traversed, and you areback at the starting vertex

at each stage of the algorithm:

the original graph minus the darkened (already used) edges = reducedgraph
important rule: never cross a bridge of the reduced graphunlessthere is no other choice
why must we observe that rule?

Notes:

the same algorithm works for Euler paths
before starting, use Euler’s theorems to check that the graph has an Eulerpath and/or circuit to find!
when you do this on paper, you can erase each edge as you traverse it
this will make the reduced graph visible, and its bridges apparent

Example
Step in recipeMarked graphReduced graph
Pick any vertex (e.g. F)

Travel from F to C

(arbitrary choice)



Travel from C to D

(arbitrary)



Travel from D to A

(arbitrary)



Travel from A to C

(can't go to B: that edge is a bridge of the reduced graph,and there
are two other choices, we chose one of them)



The rest of the trip is obvious, and the complete Euler circuit is:

(F, C, D, A, C, E, A, B, D, F)

推荐题目:



POJ 1789 POJ 1386 POJ 2337 POJ 1975(传递闭包) POJ 3360 POJ 2570 ZOJ 1798

期末考试完毕后再刷题吧T^T
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: