Изменения

Перейти к: навигация, поиск

Теорема о декомпозиции

277 байт добавлено, 18:01, 24 ноября 2015
Псевдокод
'''if''' <tex>e =</tex> NULL
'''return''' NULL
<tex> Q = Q \cup \{</tex>.push_back(<tex>e\}</tex>)
<tex> P = P \cup \{v\}</tex>
<tex> v = u </tex>
'''if''' <tex>v \in P </tex> <font color=green>// нашли цикл, удаляем из <tex>Q</tex> все ребра, найденные до того, как <tex>v</tex> была включена в <tex>P</tex></font> '''while''' (<tex>Q</tex>.begin.from <tex>\neq</tex> <tex>v</tex>) <tex>Q</tex>.pop_front()
<tex>f(Q) = f(Q)</tex> - <tex>\min\limits_{uv \in Q}f(uv) </tex>
'''return''' <tex>(f, Q)</tex>
'''fullDecomposition()'''
<tex> d = \varnothing </tex>
<tex>p = </tex> simpleDecomposition(<tex>s</tex>)
'''while''' (<tex>p \neq </tex> NULL)
<tex> d = d \cup p </tex>
<tex>p = </tex> simpleDecomposition(<tex>s</tex>)
<tex> d = d \cup p </tex>
'''for''' <tex> u \in V </tex>
<tex>p = </tex> simpleDecomposition(<tex>u</tex>)
'''while''' (<tex>p \neq </tex> NULL)
<tex> d = d \cup \{p\} </tex>
<tex>p = </tex> simpleDecomposition(<tex>u</tex>)
<tex> d = d \cup \{p\} </tex>
'''return''' <tex>d</tex>
27
правок

Навигация