当前位置:网站首页>One stroke problem (Chinese postman problem)
One stroke problem (Chinese postman problem)
2022-07-26 13:12:00 【Moresweet cat】
One stroke and the problem of Chinese postmen

One 、 Quote
One stroke problem :
- Nodes can be repeated
- You can't walk repeatedly
- It is required to walk all sides once
Olatu (Euler graph):
Start at any node , Can be a stroke
Every node has an even price ( Valence refers to the number of edges that can stretch out from this node )
![[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-gMNlOK1T-1658797650800)(imgs/image-20220725201711699.png)]](/img/4e/d2ec1a7413f555e9a592309a59f165.png)
Semi Euler graph (semi-Eulerian graph):
Only two nodes are odd valued , Others are even priced
![[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-hxE3Yb7P-1658797650801)(imgs/image-20220725202217719.png)]](/img/f5/3b1958421636d2b89e0b59ace41104.png)
A semi Eulerian graph must start with an odd valence node , To the end of another odd price , Just one stroke .
tip: One stroke problem , Because there must be entry and exit at the passing point , So the path point must be even , Because the starting point and the ending point can only enter or exit , So the starting point and ending point can be odd .
The example analysis
example 1: Determine it as eulatu 、 Semi Euler or not Euler .
![[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-N8q3Hp1P-1658797650802)(imgs/image-20220725202928156.png)]](/img/74/d73c7eff1474a3c881450db657496f.png)
a. Semi Euler graph
![[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-lyqDrB96-1658797650804)(imgs/image-20220725203522151.png)]](/img/d0/0632279f5a002e3ea698156fb44ebd.png)
b.B-A-F-E-B-C-D-E-C
example 2 A connected graph has 5 Nodes , The prices of nodes are 4,6,3,p,2
a. Explain why the graph must not be an Euler graph
b. Explain why a graph must be a semi Eulerian graph
c. Find the number of edges ( use p Express )
d. Draw a diagram with two nodes , It is required that it is neither Eulerian nor semi Eulerian 
[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-K7Pg0HWG-1658797650807)(imgs/image-20220725205109029.png)]
a. See nodes with odd prices , It must not be eulato
b. From the handshake lemma , The number of nodes with odd price must be even , therefore p It must be odd , The graph of two odd valued nodes is a semi Eulerian graph .
c. From the handshake lemma , The total price is twice the number of sides , The number of backward edges is $ \frac {p+15} {2} $
d. If two points are boundless and disconnected, they are not Euler or semi Euler , No matter how even the sides are full Euler or half Euler
notes : An Euler graph must be a connected graph (d Cited example )
![[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-AL4lZ6dD-1658797650808)(imgs/image-20220725205241622.png)]](/img/76/9360c235783c9bac11143dbb3640ff.png)
If you can't draw a stroke , It raises a question ( The Chinese postman problem )
Post office departure , Walk every way , Go back to the post office
![[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-6DCu05Xv-1658797650809)(imgs/image-20220725205707869.png)]](/img/38/dc668856103b65d9691e31a5eb03f5.png)
Euler's problem is the sum of all paths . The semi Eulerian graph is complex
![[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-4KAsG8S1-1658797650810)(imgs/image-20220725205859393.png)]](/img/e4/d411db5dbe6b805a4eb5c477a4d433.png)
According to the definition of semi Eulerian graph , The starting point can only be T perhaps Q, Otherwise, you can't draw a stroke , That means there must be some roads to go again .
terms of settlement : Complete Euler chart , The problem of Chinese postmen has become the way to make up the least , The problem of making the original graph into a full Euler graph .
The handshake lemma tells us , Add one edge for each , The price of two nodes will definitely rise by one . You can choose to supplement S To T and S To Q To make the graph full Euler .
![[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-JBCNQuET-1658797650812)(imgs/image-20220725210459329.png)]](/img/24/431d5095f2562747616f85322ce153.png)
These two edges are the ones that the postman should walk again , In this way, Chinese postmen can start from the post office and finally return to the post office , Minimum cost .
Why choose these two , Not the others , There is more than one way to make up the edges of all Euler , But choose the one that costs the least , That is to say, we should give T and Q Increase the price , And ensure the shortest global path , How to determine the ? Exhausting
A more complex example :
![[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-69IV7rmI-1658797650813)(imgs/image-20220726084400181.png)]](/img/3f/f3f1a396f2b1328a23a075271fec6b.png)
The post office is required to set the point A, It can be found that the number of odd valued nodes is 4(A、E、F、G), We need to mend the edges to finalize the path of repetition with the least cost , The combination has AE/FG、AF/EG、AG/EF
The costs are calculated as
AE+FG = 26 + 22 =48
AF+EG = 35 + 7 = 42
AG+EF = 19 + 20 = 39
So we decided to mend the edges AG and EF
Consider more complex scenarios : There are no starting and ending points , In this way, the graph can be treated as a semi Eulerian graph , Just mend one side .
![[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-eMyEliL2-1658797650814)(imgs/image-20220726085616270.png)]](/img/31/5cef3f628ded15b6ca5006d4d5f796.png)
This choice is based on AF Two points as the beginning and end , take EG The edge of two points is used as the complementary edge to repeat , The total cost can be minimized .
边栏推荐
- 1312_ Apply 7z command for compression and decompression
- SLAM 02.整体框架
- Flutter prevents scientific counting and removes mantissa invalid 0
- Food safety | can you eat any fruit?
- Reflection, an implementation of automatic repeated call interface
- MySQL data directory (3) -- table data structure MyISAM (XXVI)
- 基于BERT的情感分析模型
- Where is safe to open an account when buying stocks on mobile phones?
- Chat system based on webrtc and websocket
- Huawei recruited "talented teenagers" twice this year; 5.4 million twitter account information was leaked, with a selling price of $30000; Google fired engineers who believed in AI consciousness | gee
猜你喜欢

Niuke brush sql---2

【5G】5G中的CU和DU是什么?

New function | intelligent open search online customized word weight model
![[typescript] typescript common types (Part 1)](/img/80/5c8c51b92d3a9d76f38beba7be0aa6.png)
[typescript] typescript common types (Part 1)

0 basic programming resources (collect first ~ read slowly ~)

From January to June, China's ADAS suppliers accounted for 9%, and another parts giant comprehensively laid out the new smart drive track

AI-理论-知识图谱1-基础

RMII, smii, gmii, rgmii interfaces of Ethernet Driver

HCIP第十二天笔记整理(BGP联邦、选路规则)

The difference between $route and $route
随机推荐
关于自动重复调用接口的一种实现方式-反射
C#把Type当做泛型T,来作为方法的泛型进行使用
Today in history: IBM obtained the first patent; Verizon acquires Yahoo; Amazon releases fire phone
B+树(5)myISAM简介 --mysql从入门到精通(十七)
基于C#开放式TCP通信建立与西门子PLC的socket通信示例
New function | intelligent open search online customized word weight model
Code examples explain the difference between [reentrant lock] and [non reentrant lock]?
Kubernetes----PV和PVC的生命周期简介
LeetCode 263.丑数
V01 - XX, record a good life from the log
基于C#实现的学生考试系统
panic: Error 1045: Access denied for user ‘root‘@‘117.61.242.215‘ (using password: YES)
12 brand management of commodity system in gulimall background management
[typescript] typescript common types (Part 1)
2022 employment season! Adobe helps creative industry workers break through the shackles of skills and return to the source of ability
Chat system based on webrtc and websocket
JVM: what does the class loading subsystem do? What is it made of? What eight part essay do you need to remember?
B+树挑选索引(2)---mysql从入门到精通(二十三)
深度学习3D人体姿态估计国内外研究现状及痛点
About the copy of picture address links