1. 程式人生 > >[轉]圖論500題

[轉]圖論500題

=============================以下是最小生成樹+並查集======================================【HDU】1213 How Many Tables基礎並查集★1272 小希的迷宮基礎並查集★1325&&poj1308 Is It A Tree?基礎並查集★1856 More is better基礎並查集★1102 Constructing Roads基礎最小生成樹★1232 暢通工程基礎並查集★1233 還是暢通工程基礎最小生成樹★1863 暢通工程基礎最小生成樹★1875 暢通工程再續基礎最小生成樹★1879 繼續暢通工程基礎最小生成樹★3371    Connect the Cities  簡單最小生成樹★1301 Jungle Roads基礎最小生成樹★1162 Eddy's picture基礎最小生成樹★1198 Farm Irrigation基礎最小生成樹★1598 find the most comfortable road列舉+最小生成樹★★1811 Rank of Tetris並查集+拓撲排序★★3926 Hand in Hand同構圖★3938 Portal  離線+並查集★★2489    Minimal Ratio Tree dfs列舉組合情況+最小生成樹★4081    Qin Shi Huang's National Road System 最小生成樹+DFS★★4126    Genghis Khan the Conqueror 列舉+最小生成樹+DFS(難)★★★★1829&&poj2492 A Bug's Life基礎種類並查集★1558 Segment set計算幾何+並查集★3461 Code Lock並查集(有點難想到)★★3367 Pseudoforest最大生成樹★2473 Junk-Mail Filter並查集+設立虛父節點(馬甲)★★3172 Virtual Friends帶權並查集★3635 Dragon Balls帶權並查集★3047 Zjnu Stadium帶權並查集★3038 How Many Answers Are Wrong種類並查集★★2818 Building Block帶權並查集★3234 Exclusive-OR異或並查集(難)★★★2121    Ice_cream’s world II  最小樹形圖(要輸出根有點噁心)★★4009    Transfer water 最小樹形圖(模板題)★3311  Dig The Wells  斯坦納樹(狀壓DP)(模板題)★★4085Peach Blossom Spring斯坦納樹(狀壓DP)(有可能是森林...)★★★2586 How far away ?LCA★2874 Connections between citiesLCA★3486 IntervieweRMQ★2888 Check Corners二維RMQ★3183A Magic LampRMQ(有點難想到,有點難聯絡到RMQ)★★【POJ】1258 最經典的MST★1789 Truck History 最小生成樹★1287 Networking 簡單★2349 Arctic Network簡單★1611 The Suspects 並查集★2377 kruskal★2524 Ubiquitous Religions 並查集★2236 Wireless Network 並查集+計算幾何★2560 Kruskal 並查集★1861 Kruskal ★3625 prim★1679 - The Unique MST(基礎)  判斷MST是否唯一★3522 - Slim Span(基礎)  求一顆生成樹,讓最大邊最小邊差值最小★2485 Highways MST中的最長邊★2395 最小生成樹的最長邊★1751 Highways 求出方案★POJ-1182 食物鏈 種類並查集★★POJ 1456 Supermarket貪心+區間合併★POJ-1703 種類並查集★POJ-1988 種類並查集★POJ-1733 Parity game 種類並查集,先要離散化一下,不影響結果★POJ-1417 True Liars(難) 並查集+DP 種類並查集★★POJ-2912 Rochambeau(難) baidu的題,很不錯...是食物鏈的加強版.判斷裁判比較難想.★★★POJ 2728 Desert King(中等)  最優比率生成樹★★POJ 1639 Picnic Planning(較難) 頂點度數有限制的最小生成樹★★POJ 3164 Command Network(難) 最小樹形圖★★poj3723好題!!! ★★poj3228好好題!!! ★★【ZOJ】ZOJ-3261 逆向並查集 ★★===============================以下是最短路系列====================================
【HDU】1548    A strange lift基礎最短路(或bfs)★2544    最短路 基礎最短路★3790   最短路徑問題基礎最短路★2066   一個人的旅行基礎最短路(多源多匯,可以建立超級源點和終點)★2112    HDU Today基礎最短路★1874    暢通工程續基礎最短路★1217    Arbitrage   貨幣交換 Floyd (或者 Bellman-Ford 判環)★1245    Saving James Bond計算幾何+最短路★1317    XYZZY  Bellman-Ford判環,有負權★1535    Invitation Cards   有向圖的來回最短路,(反向建圖)★1546    Idiomatic Phrases Game  最短路★2680    Choose the best route   最短路★2923    Einbahnstrasse最短路★3339    In Action  最短路+揹包★2224    The shortest path雙調旅行商問題★★2807    The Shortest Path矩陣運算+最短路(floyd)★★1595    find the longest of the shortest列舉+最短路(刪掉任意一條邊的最長最短路)★★3986    Harry Potter and the Final Battle 列舉+最短路(刪掉任意一條邊的最長最短路)★★1599    find the mincost routefloyd求最小環★1839Delay Constrained...二分下限+最短路(帶限制最短路)★★3631 Shortest Path                   Floyd插點法★★4114Disney's FastPass最短路+二維狀壓DP(難)★★★3832    Earth Hour三點連通(斯坦納樹)★3873    Invade the MarsDij變體(好題!,帶限制最短路)★★★4063 Aircraft幾何構圖+最短路★★★★hdu4179Difficult Routesdis[][]開二維狀態的最短路(帶限制最短路)★★1869 六度分離 Floyd最短路★1385    Minimum Transport Cost    最短路+輸出路徑(輸出字典序最小路徑,有點噁心)★★1224    free DIY Tour 最短路+輸出路徑★1142    A Walk Through the Forest  最短路+記憶搜尋★★1596    find the safest road   乘積最小的最短路★1598    find the most comfortable road二分速度差+最短路(帶限制最短路)★★2722    Here We Go(relians) Again最短路★2962    Trucking  二分+最短路(帶限制最短路)★★1690    Bus System 最短路★2433    Travel刪邊+最短路之和(預處理橋邊)★★★2363    Cycling二分+最短路(帶限制最短路)★★2377    Bus Pass最短路(尋找一個點的最長最短路最小)★★2833    WuKong最短路+記憶化搜尋(求兩條最短路的最多公共點)★★1688    Sightseeing最短次短路條數★★3191    How Many Paths Are There次短路條數★★2482    Transit search最短路★★★3768 Shopping最短路+dfs(或最短路+狀壓DP)★★3035    War平面圖最小割(建圖麻煩)★★3870    Catch the Theves 平面圖最小割(建圖麻煩)★★3860Circuit Board平面圖最小割(建圖麻煩)★★【POJ】1062 昂貴的聘禮竟然可以和最短路聯絡起來★★1094 Sorting It All OutFloyd判環+拓撲排序★1125Stockbroker GrapevineFloyd★1135 Domino Effect最短路,比較有意思★★1161 Walls最短路(圖太噁心了)★★1502 MPI MaelstromFloyd★1511    Invitation Cards來回最短路★1556The Doors  計算幾何+最短路★★1724 ROADS帶限制的最短路,dis[][]開二維來記錄資訊(或廣搜)★★1734 Sightseeing tripfloyd最小環路徑★1797 Heavy Transportation二分列舉+最短路★1847 Tram簡單最短路★1860Currency Exchange貨幣兌換★1949 Chores反向建邊,求最長路★★2139 Six Degrees of Cowvin BaconFloyd★2240Arbitrage貨幣兌換★2253Frogger二分+最短路★2312 坦克大戰spfa最短路本質變形-->廣搜★2387 Til the Cows Come Home基礎最短路★2394Checking an Alibi最短路★2449Remmarguts' DateA*求第K短路★★2457 Part Acquisition最短路 (輸出路徑)★★2472 106 miles to Chicago乘積最短路(log一下,乘變加)★★2502Subway2570 Fiber Network floyd3013 聖誕樹3037Skiing3072 Robot3114 Countries in War 強聯通+最短路3160 Father Christmas flymouse 強聯通+最長路3255 Roadblock3259 Wormholes(尋找負權迴路)3268 Silver Cow Part3311 Hie with the Pie floyd+狀壓3328 Cliff Climbing3439 Server Relocation3463 Sightseeing 次短路條數31593521Geometric Map計算幾何+最短路3549GSM phone 計算幾何+最短路3594 Escort of Dr. Who How3613 Cow Relays  經過N條邊的最短路 // floyd + 二分矩陣3615 Cow Hurdles3621 最優比率環3635 full tank?3660 傳遞閉包3662 Telephone Lines============================以下是差分約束系列============================
【HDU】1384 Intervals1529 Cashier Employment1531 King1534 Schedule Problem3440 House Man3592 World Exhibition3666 THE MATRIX PROBLEM【POJ】120112751364171629492983315931693687============================以下是二分匹配系列============================普通匹配,多重匹配【HDU】1068Girls and Boys1150Machine Schedule1151Air Raid1179Ollivanders: Makers of Fine Wands since 382 BC.1281棋盤遊戲149850 years, 50 colors1507Uncle Tom's Inherited Land*1528Card Game Cheater1845Jimmy’s Assignment2063過山車2119Matrix2444The Accomodation of Students2768Cat vs. Dog3081Marriage Match II3360National Treasures1045也可搜尋1350最小路徑覆蓋3118類似二分匹配3729238910542819完全匹配1668 二分+多重匹配3605多重匹配3861強連通+二分匹配2236無題IIhdu3468hdu4185奇偶匹配【POJ】1087A Plug for UNIX1274 The Perfect Stall1469COURSES1486 Sorting Slides 二分圖的必須邊1548Robots1698Alice's Chance1719Shooting Contest1904 King's Quest 求二分圖所有可能的匹配邊2060 Taxi Cab Scheme 最小路徑覆蓋2112 Optimal Milking 二分+多重匹配2226 Muddy Fields 行列的覆蓋2239 Selecting Courses2289 Jamie's Contact Groups 二分+多重匹配2446 Chessboard2536 Gopher II2584T-Shirt Gumbo2594 Treasure Exploration 可相交最小路徑覆蓋2672Hotkeys2724 Purifying Machine3020 Antenna Placement3041 Asteroids 簡單行列匹配 3189Steady Cow Assignment 二分+多重匹配3207 Ikki's Story IV - Panda's Trick3216 Repairing Company3343 Against Mammoths3692 Kindergarten2771最大獨立集============================以下是KM算法系列============================
【HDU】2255奔小康賺大錢1533Going Home1853Cyclic Tour3488Tour3435A new Graph Game2426Interesting Housing Problem2853Assignment3718Similarity3722Card Game3395Special Fish2282Chocolate2813One fihgt one2448Mining Station on the Sea3315My Brute3523Image copy detection【POJ】2195 Going Home 最小權值匹配2400 Supervisor, Supervisee 輸出所有最小權匹配2516 Minimum Cost 最小權值匹配或最小費用流3565Ants3686 The Windy's 最小權值匹配============================以下是最大團&穩定婚姻系列============================【HDU】1530Maximum Clique1435Stable Match3585maximum shortest distance 二分+最大團1522Marriage is Stable1914The Stable Marriage Problem【POJ】1129四色定理 著色問題1419最大獨立集2989極大團3487 The Stable Marriage Problem 穩定婚姻============================以下是強雙聯通系列============================【HDU】強連通:1269  迷宮城堡  判斷是否是一個強連通2767Proving Equivalences  至少加幾條邊讓整個圖變成強連通3836 Equivalent Sets  至少加幾條邊讓整個圖變成強連通1827   Summer Holiday  傳遞的最小費用3072    Intelligence System  傳遞的最小費用3861The King’s Problem 強連通+二分匹配3639Hawk-and-Chicken  強連通縮點 + 樹形dp(累加子節點的總權值)3594 Cactus 仙人掌圖雙連通:2242考研路茫茫——空調教室  雙聯通縮點+樹形DP2460Network 邊雙連通3849By Recognizing These Guys, We Find Social Networks Useful  雙連通求橋3896Greatest TC  雙連通4005 The war  邊雙連通LCA:2586How far away ?2874Connections between cities3078Network  LCA+排序3830Checkers  二分+LCA【POJ】強連通:1236Network of Schools2553 The Bottom of a Graph  好題! 找出度為0的集合2186    Popular Cows  好題! 找出度為0的,其他分量都指向它的集合2375Cow Ski Area 強連通2762    Going from u to v or from v to u?  縮點+拓撲排序3160   Father Christmas flymouse  強連通+最短路3180 The Cow Prom  判斷有幾個環, 分量中元素大於1的個數3114Countries in War  強連通+最短路3592Instantaneous Transference  強連通分量+最長路1904King's Quest  強連通+並查集 雙連通:3694 Network  邊雙連通 (同hdu2460)3177 Redundant Paths   構造邊雙連通3352 Road Construction   構造邊雙連通2942 Knights of the Round Table (點雙連通經典題)1515 Street Directions (無向圖改有向圖)1438 One-way Traffic  (混合圖改有向圖)LCA:1330Nearest Common Ancestors1470Closest Common Ancestors1986Distance Queries3417Network3728The merchant  LCA+並查集,更新詢問2763Housewife Wind LCA+樹狀陣列============================以下是2-SAT系列============================【HDU】3062 Party1824 Let's go home3622 Bomb Game3715 Go Deeper1815 Building roads2723 Get Luffy Out1816 Get Luffy Out *1814 Peaceful Commission4115 Eliminate the Conflict【POJ】2296 Map Labeler2723 Get Luffy Out2749  Building roads3207  Ikki's Story IV - Panda's Trick3648 Wedding3678 Katu Puzzle3683  Priest John's Busiest Day3905 Perfect Election============================以下是歐拉回路系列============================【HDU】1878歐拉回路  判斷3018Ant Trip 一筆畫問題11162894茲鼓歐拉回路19563472混合尤拉【POJ】2513  尤拉路1041  John's trip  歐拉回路1386 Play on Words  單詞接龍2230Watchcow  歐拉回路2513 Colored Sticks  無向圖尤拉路2337 Catenyms  尤拉路徑1392 Ouroboros Snake  茲鼓歐拉回路1780  code1637  混合尤拉【zoj】1992============================以下是拓撲排序系列============================【HDU】1285確定比賽名次2094產生冠軍2647Reward3342Legal or Not1811Rank of Tetris  拓撲+並查集3231 三維拓撲【POJ】1094 Sorting It All Out  Floyd+拓撲2367 Genealogical tree3660 Cow Contest3687 Labeling Balls 神奇的拓撲1128Frame Stacking  DFS版拓撲1270Following Orders  拓撲+回溯1420Spreadsheet  模擬拓撲2762Going from u to v or from v to u?  強連通+拓撲3553Task schedule============================以下是競賽圖系列============================競賽圖下的哈密頓問題Strange Country IIZOJ-3332Task SequencesPOJ-1776The bookSGU-122Tour RoutePOJ-3780Tour RouteHDOJ-3414============================以下是網路流系列============================【HDU】1532Drainage Ditches(基礎)[最大流]3549Flow Problem(基礎)[最大流]3572Task Schedule[最大流]任務分配,判斷滿流2732Leapin' Lizards(難)[最大流]3338Kakuro Extension[最大流][數和]神奇最大流行進列出2883kebab[最大流]判斷滿流3605Escape[最大流](多重匹配3081Marriage Match II[二分最大流]+並查集3277Marriage Match III[二分最大流]同上,多了拆點3416Marriage Match IV[最大流]最短路+最大流2485Destroying the bus stations[最大流]最短路+最大流3468Treasure Hunting[最大流](二分匹配)+最短路3551Hard Problem[最大流]3998Sequence(難)[DP+最大流]最長上升子序列3917Road constructions[最大權閉包]3879Base Station[最大權閉包]3061Battle[最大權閉包]3996Gold Mine[最大權閉包]3472HS BDC[混合尤拉]hdu4183來回走不重複點的網路流.-------------------------1533Going Home(基礎)[費用流]3488Tour[費用流]圈3435A new Graph Game[費用流]圈1853Cyclic Tour[費用流]圈2686Matrix[費用流]3376Matrix Again[費用流]3667Transportation[費用流]拆邊3315My Brute[費用流](可用KM)3395Special Fish[費用流](可用KM匹配)2448Mining Station on the Sea[費用流](可用最短路+KM匹配)4067Random Maze(難)[費用流]3947River Problem(難)[費用流]神奇費用流,流量不等式建圖3046Pleasant sheep and big big wolf [最小割]1565方格取數(1)[最小割]1569方格取數(2)[最小割]3820Golden Eggs[最小割]方格加強3491Thieves[最小割]最小點割集3657Game[最小割]最大點權獨立集3313Key Vertex[最小割]3251Being a Hero[最小割]3157Crazy Circuits[上下流]3002King of Destruction[全域性最小割]3691Nubulsa Expo[全域性最小割]【POJ】1087A Plug for UNIX  [最大流](可用二分匹配)1274The Perfect Stall [最大流](可用二分匹配)1325Machine Schedule[最大流](可用二分匹配)1698Alice's Chance[最大流](可用二分匹配)2239Selecting Courses[最大流](可用二分匹配)2446Chessboard[最大流](可用二分匹配) 好題啊2536Gopher II[最大流](可用二分匹配)2771Guardian of Decency[最大流]二分匹配最大獨立集3041 Asteroids [最大流](簡單二分匹配)2584 T-Shirt Gumbo [最大流](多重匹配)3189 Steady Cow Assignment(中等)[二分最大流](多重匹配)1149 PIGS  [最大流] 絕對經典的構圖題1273 Drainage Ditches  [最大流](基礎)1459 Power Network(基礎)[最大流]3281 Dining [最大流]2112 Optimal Milking(基礎)  [二分最大流]2289 Jamie's Contact Groups [二分最大流]2391 Ombrophobic Bovines(中等) [二分最大流]2455 Secret Milking Machine(基礎) [二分最大流]3228 Gold Transportation [二分最大流](並查集)2699 The Maximum Number of Strong Kings(較難)  [列舉人數 + 最大流]3498March of the Penguins(中等)  [最大流]列舉匯點,滿足點容量限制的網路流2987 Firing(較難)  [最大權閉包]1637 Sightseeing tour(Crazy)  [混合尤拉]2135 Farm Tour  [費用流] (來回最短路)2175Evacuation Plan(中等) [費用流] 消圈2195Going Home[費用流]2516 Minimum Cost [費用流]3422 Kaka's Matrix Travels(中等)  [費用流]拆點3680 Intervals(較難)  [費用流]經典,費用流+離散化3686The Windy's[費用流](KM匹配)3762The Bonus Salary![費用流]1815 Friendship(中等)  [最小割]最小點割集1966  Cable TV Network(中等)  [最小割]最小點割集2125 Destroying The Graph(難)  [最小割]最小點權覆蓋3084 Panic Room(中等,好題)  [最小割]邊連通度3204 Ikki's Story I - Road Reconstruction(基礎) [最小割]求關鍵邊3308 Paratroopers(較難) [最小割]乘積取對數,最小點權覆蓋3436ACM Computer Factory[最小割]收集流,殘留蒐集找邊3469 Dual Core CPU(中等)  [最小割]收集流3921Destroying the bus stations[最小割]點連通2396 Budget(中等)  [有源匯的上下界可行流]3155 Hard Life(很挑戰一題)  [最大密度子圖]2914Minimum Cut[無向圖最小割]============================以下是dancing links系列============================1001Easy FindingPOJ-37401002Power StationsHDOJ-36631003Treasure MapZOJ-32091004LampHDOJ-28281005whosyourdaddyHDOJ-34981006Bomberman - Just Search!HDOJ-35291007Square DestroyerPOJ-10841008MatrixHDOJ-21191009DivisibilityHDOJ-33351010RadarHDOJ-22951011Fire stationHDOJ-36561012Repair DepotsHDOJ-31561013DominoesHDOJ-25181014Street FighterHDOJ-39571015Sudoku KillerHDOJ-14261016SudokuPOJ-26761017SudokuPOJ-30741018SudokuPOJ-30761019Su-Su-SudokuHDOJ-27801020SudokuHDOJ-31111021SudokuHDOJ-39091022Squiggly SudokuHDOJ-40691023Triangle War IIZOJ-30381024A Puzzling ProblemHDOJ-16031025Maximum CliqueHDOJ-1530hust1017 精確覆蓋。fzu1686,nuaa1507 重複覆蓋。hit2199,2882,2959 精確覆蓋(數獨)。SPOJ1771精確覆蓋(N皇后問題)。poj3435