1 / 16

Курстук иш

Курстук иш. Багытталган графтар. М азмуну. Граф ...................................................................................................................... 3 Негизги түшүнүктөр ..............................................................................................4

Download Presentation

Курстук иш

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Курстук иш Багытталган графтар

  2. Мазмуну • Граф......................................................................................................................3 • Негизги түшүнүктөр..............................................................................................4 • Мисалдар..............................................................................................................5 • Багытталган граф.................................................................................................8 • Топологиялык сорттоо..........................................................................................9 • Мисал...................................................................................................................10 • Булактар...............................................................................................................11

  3. Граф • Граф – бул, бири-бири менен байланышкан, бир нече объекттердин жыйындысы. Багытталбаган граф деп дагы аталат. • 3 түрү бар: - Багытталган граф - Аралаш граф - Изоморфтуу граф

  4. Негизги түшүнүктөр • Объекттер чоку жана түйүн катары каралат. • Кабырга– бул эки чекитти(элемент, объект) байланыштырган сызык. • Жаа – бул багыты бар кабырга.

  5. Мисалдар • Багытталбаган граф

  6. Мисалдар • Багытталган граф

  7. Мисалдар • Аралаш графтар

  8. Багытталган граф - бул бардык кабыргалары багыттуу граф. Тагыраак айтканда жаалуу граф.

  9. typedef pair<int,int> rib; typedefvector<rib> graph_line; typedefgraph_line::iterator graph_iter; typedefvector<graph_line> graph; constintinf = 1000*1000*1000; intmain() { int n; graph g; vector<long long> d (n, inf); d[0] = 0; vector<int> from (n, -1); from[0] = 0; for(int count=1; count<n; count++) { boolanychanged = false; for(int v=0; v<n; v++) if(d[v] != inf) for(graph_iteri=g[v].begin(); i!=g[v].end(); ++i) { int to = i->first, l = i->second; if(d[to] > d[v]+l) { d[to] = d[v]+l; from[to] = v; anychanged= true; } } if (!anychanged) break; }

  10. Топологиялык сорттоо Топологиялык сорттоо – бул, графтардагы көптөгөн маселелерди чечүү үчүн негизги алгоритмдердин бири. Топологиялык сорттоонун негизги максаты – бул, графтагы мааниси(индекси) төмөн болгон чокудан мааниси(индекси) жогору болгон чокуга жаанын түз сызыктуу тартипте(ирет) жайгаштырылышы.

  11. Мисал

  12. Булактар • http://ru.wikipedia.org/wiki/%D0%93%D1%80%D0%B0%D1%84_(%D0%BC%D0%B0%D1%82%D0%B5%D0%BC%D0%B0%D1%82%D0%B8%D0%BA%D0%B0) • http://www.natalka1122.com/rkt/GosExam/answers/07.htm • http://acadclasses.narod.ru/math/lecture13.htm • http://ru.wikipedia.org/wiki/%D0%9E%D1%80%D0%B8%D0%B5%D0%BD%D1%82%D0%B8%D1%80%D0%BE%D0%B2%D0%B0%D0%BD%D0%BD%D1%8B%D0%B9_%D0%B3%D1%80%D0%B0%D1%84 • http://grafielk.narod.ru/HTMLs/theory9.html • http://habrahabr.ru/post/100953/

  13. THE END THANK YOU FOR ATTENTION!!!   

More Related