Greedy Algorithm



Download 97,97 Kb.
bet5/12
Sana23.06.2022
Hajmi97,97 Kb.
#696905
1   2   3   4   5   6   7   8   9   ...   12
Bog'liq
greedy (1)

Minimum Spanning Trees


Let's transition to a graph theory problem. The relevant graph definitions can be found at the beginning of Section 6 on Graph Algorithms.
All these definitions lead to the following natural question.


Exercise 5.7 (Minimum Spanning Tree) . Given a connected graph G = ( V, E, w ) with positive weights, find a spanning tree of minimum weight (an MST).
Since we are interested in greedy solution, our intuition should be to build the minimum spanning tree up edge by edge until we are connected. My suggestion here is to think about how we can select the first edge. Since we are looking for minimum weight tree, let's pick the minimum weight edge in the graph (breaking ties arbitrarily). Then to pick the second edge, we could pick the next minimum weight edge. However, when we pick the third edge, we have no guarantee that the 3rd least weight edge doesn't form a triangle (ie 3-cycle) with the first two. So, we should consider picking the third edge as the least weight edge that doesn't form a cycle. And so on. . . Let's formalize this train of thought.
Definition 5.8 (Multi-cuts and Coarsenings) . A multi-cut S of a connected graph G is a partition of V into non-intersecting blocks S 1 ,. . . , S k . An edge crosses S if its endpoints are in different blocks. A multi-cut coarsens a subgraph G j if no edge of G j crosses it.





S

S
Figure 5.2: On the left, an example of a multi-cut of a graph G. The partitions are the separately colored blocks. On the right, a subgraph G j of G that coarsens . No edge of G j crosses the partition.
W e start with the emp t y forest ie all v e r t ic es and no edges: G 0 = ( V , ∅ ). Le the m ulticut S 0 be the unique multicut where each vertex is in its unique block. Also, as there are no edges, this multicut S 0 coarsens G 0 . Our strategy will be to add the edge of the minimum weight of G that crosses S 0 . This produces another forest G 1 (this time with n - 1 trees in the forest). Let S 1 be the multicut formed by taking each tree as a block. To build G 2 , we add the edge of minimum weight of G that crosses S 1 . G 2 has n - 2 trees in the forest. We define S 2 to be the multicut formed by taking each tree as a block. And so on until we reach S n - 1 which is the trivial partition. The edges in G n - 1 form the MST.

Download 97,97 Kb.

Do'stlaringiz bilan baham:
1   2   3   4   5   6   7   8   9   ...   12




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©www.hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish