Poj graph theory and network stream problems

Source: Internet
Author: User

Poj 2449 remmarguts 'date (medium)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 2449
Typical problem: K Short Circuit
Solution: Dijkstra + A * (REC), many methods
Related: http://acm.pku.edu.cn/JudgeOnline/showcontest? Contest_id = 1144
This question is also included in the search recommendation question

Poj 3013-big Christmas tree (basic)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 3013
Question: The simplest and most short circuit, but this question is too long. It requires better program speed and accuracy.
Solution: Dijkstra

Poj 3463-Sightseeing (medium)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 3463
Question: Number of Shortest Path and 1 greater than Shortest Path
Solution: You need to understand Dijkstra

Poj 3613-cow relays (difficult)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 3613
Question: Obtain the shortest path of n sides.
Solution: Floyd + multiply, greedy

Poj 3621-Sightseeing cows (moderate)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 3621
Question: finding a loop, happy value/maximum total path
Solution: parameter search + shortest short circuit (MS original Bellman TLE, only through spfa)

Poj 3635-Full tank? (Medium)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 3635
Question: Transient Deformation
Solution: guangsearch
Related: http://hi.baidu.com/hnu_reason/blog/item/086e3dccfc8cb21600e9286b.html

Tree Generation
The basic spanning tree is not put.

Poj 1639-Picnic planning (difficult)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 1639
Question: Minimum Spanning Tree with a limited vertex level
Solution: greedy + prim/Kruskal

Poj 1679-the unique MST (basic)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 1679
Determine whether the MST is unique
Solution: Prim is enough, but it is easy to make mistakes.

Poj 2728-desert King (medium)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 2728
Question: the so-called optimal Ratio Spanning Tree
Solution: parameter search + prim

Poj 3164-Command Network (hard)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 3164
Question: minimum tree structure
Solution: The Liu Zhu algorithm is less likely to be obtained?

Poj 3522-slim span (basic)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 3522
Ask a spanning tree to minimize the difference between the smallest edge and the smallest edge.
Solution: Use Kruskal

Connectivity, degree, and Topology Problems
This type of problem involves techniques such as DFS and point reduction.

Poj 1236-network of schools (basic)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 1236
Question: How many sides can be added to a fully connected graph?
Solution: scale down, view degree

Poj 1659-frogs 'neighborhood (basic)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 1659
Question: Build a chart based on the degree Sequence
Solution: greedy. For detailed proof, see Havel theorem.

Poj 2553-the bottom of a graph (basic)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 2553
Poj 2186-popular cows (basic)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 2186
Point in degree 0

Poj 2762-going from u to V or from V to u? (Medium)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 2762
Question: Determination of unidirectional Connected Graphs
Solution: shrink point + dp find the longest chain

Poj 2914-minimum cut (hard)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 2914
Objective: undirected graph minimal cut
Solution: stoer-Wagner algorithm. network stream and enumeration are used to determine whether

Poj 2942-Knights of the Round Table (difficult)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 2942
Question: Check whether the dual-China Unicom component (or block) contains an odd circle
Solution: Obtain the dual-connected components and then perform black and white dyeing to determine the bipartite graph.
Related: http://hi.baidu.com/zfy0701/blog/item/57ada7ed104ce9d2b31cb104.html

Poj 3177-redundant paths (moderate)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 3177
Poj 3352-road construction (moderate)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 3352
Question: How many sides can be added to a bidirectional connected graph?
Solution: scale down the Vertex Tree of different parts separated by the cut edge to see the inbound degree
We recommend that you compare the number of edges added to a directed graph to a strongly connected graph in the following figure: 1236.

Poj 3249-Test for job (basic)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 3249
Solution: BFS/DFS + dp

Poj 3592-instantaneous transference (basic)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 3592
Solution: scale down, longest path, few people do water questions, pay attention to details

Poj 3687-labeling bils (medium)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 3687
Solution: topological sorting

Poj 3694-Network (medium)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 3694
Solution: Dual-Connected Component + query set

2-SAT problems
It is not difficult to understand the meaning of this type of problem.

Poj 2723-Get Luffy out (moderate)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 2723
Poj 2749-building roads (difficult)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 2749
Solution: Binary + 2-Sat Determination

Poj 3207-Ikki's Story IV-panda's trick (basic)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 3207
Solution: simple 2-Sat, but other methods are faster

Poj 3648-wedding (medium)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 3648
Solution: it would be interesting to use 2-Sat, but the brute force search still takes 0 ms.

Poj 3678-Katu puzzle (basic)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 3678
Solution: simply verify the Image Based on the Union diagram.

Poj 3683-priest John's busiest day (medium)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 3683
Solution: Compatibility diagram between N ^ 2 enumeration points, solving 2-Sat

Maximum Flow Problems
There are many variants, and the understanding of the maximum flow theorem of the minimum cut is the key

Poj 1149-pigs (difficult)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 1149
Absolutely classic architecture questions

Poj 1273-drainage ditches (basic)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 1273
Maximum inbound door

Poj 1459-Power Network (basic)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 1459
Basic Diagram

Poj 1637-Sightseeing Tour (crazy)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 1637
Question: Check whether the Euler's trace of a hybrid graph exists.
Solution: undirected edges, arbitrary orientation, diagram, detailed introduction to the Black Book p324

Poj 1815-friendship (medium)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 1815
Question: Minimum Cut
Solution: Split points into edge Cutting
Related: http://hi.baidu.com/zfy0701/blog/item/a521f230b06dea9fa9018e0e.html

Poj 1966-cable TV network (medium)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 1966
Question: How many points are removed to make the graph not connected?
Solution: Determine any Source Vertex, enumerate the sink vertex to obtain the vertex cut set (convert to the Edge Cut), and find the smallest vertex cut

Poj 2112-optimal milking (basic)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 2112
Binary enumeration, maximum stream

Poj 2391-ombrophobic bovines (medium)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 2391
Question: Floyd, split point, binary Enumeration
Related: http://hi.baidu.com/zfy0701/blog/item/3e0006c4f73f0eaf8226acff.html

Poj 2396-budget (medium)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 2396
Question: a feasible upstream/downstream stream with a source sink
Solution: Use the matrix-Network Flow Model to map and then split the edge
Related: http://hi.baidu.com/zfy0701/blog/item/6449d82a64e15e3e5343c1ba.html
, The Application of the minimal cut model in the competition

Poj 2455-secret milking machine (basic)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 2455
Binary enumeration. In general, you need to write an update operation on the edge capacity instead of re-composing all the elements each time.

Poj 2699-the maximum number of strong kings (difficult)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 2699
Solution: enumerative users + maximum stream (thanks to the prompt for creating the xpcnq_71 dashboard)

Poj 2987-firing (difficult)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 2987
Question: Maximum permission Closure
Solution: enlarge edge weight first. The first question is "Total"-"maximum flow", and the second question is "minimum cut ".
Related: http://wywcgs.spaces.live.com/blog/cns! 4d861a02a3382142! 1109. Entry? & _ C02_owner = 1
Profit (medium)
Http://www.vijos.cn/Problem_Show.asp? Id = 1352
Special situations of the max weight closure Graph
This is also the type of zoj 2071-technology trader.
Http://acm.zju.edu.cn/show_problem.php? PID = 1, 2071

Poj 3084-panic room (medium, good question)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 3084
Question: omitted
Solution: Modeling Based on the Minimum Cut

Poj 3155-hard life (challenging)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 3155
Question: maximum density subgraph
Solution: parameter search + max weight closure diagram, A. V. Goldberg paper (NB solution)
The application of the minimal cut model in the informatics Competition

Poj 3189-Steady cow assignment (medium)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 3189
Question: finding the smallest interval to complete matching
Solution: This question fully demonstrates the strength of SAP, which is purely violent. A better way is to continually Delete edges and add edges to continue the network flow process during the enumeration interval.

Poj 3204-Ikki's story I-road reconstruction (basic)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 3204
Zoj 2532-Internship (basic)
Http://acm.zju.edu.cn/show_problem.php? PID = 1, 2532
Determine whether an edge is in a cut.
Solution ))

Poj 3308-paratroopers (difficult)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 3308
Poj 2125-destroying the graph (hard)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 2125
Question: Least vertex weight coverage

Poj 3469-dual core CPU (medium)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 3469
Question: Minimum Cut

Poj 3498-March of the Penguins (moderate)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 3498
Question: network stream that meets the point Capacity Limit
Solution: Split points convert the point capacity to the edge capacity, and enumerate the points

Zoj 2587-unique attack (difficult)
Http://acm.zju.edu.cn/show_problem.php? PID = 1, 2587
Determine whether the minimum cut is unique
Solution: understand the nature of the DFS Minimum Cut Algorithm.

Spoj 839-optimal marks (hard)
Http://www.spoj.pl/problems/OPTM/
Question: omitted
Solution: Very classic. For details, see Amber's training team paper. Calculate the minimum cut based on each digit of the number.

Sgu 326-Perspective (medium)
Http://acm.sgu.ru/problem.php? C0 & proble m = 326
Classic Graph

Cost Flow Problems
The solutions that can be obtained by km are not placed here. In addition, unless a special graph is used, the continuous augmented Path Algorithm is enough.

Poj 2175-evacuation plan (medium)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 2175
Question: Determine whether a given solution is the optimal solution.
Solution: Construct a stream based on the given plan, and then consume only one negative circle

Poj 3422-Kaka's matrix travels (moderate)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 3422
Question: omitted
Solution: Split points

Poj 3680-intervals (difficult)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 3680
Question: omitted. This question is still quite classic.
Solution: details in discuss

Spoj 371-boxes (simple)
Http://www.spoj.pl/problems/BOXES/
Question: omitted
Solution: billing flow, but it seems better than Network Flow

Sgu 185-two shortest (medium)
Http://acm.sgu.ru/problem.php? C0 & proble m = 185
Question: find two shortest paths
Solution: Charge flow, which can also be the shortest path + the largest stream.

Matching Problem
It is important to correctly understand the KM algorithm.

Here I would like to say a few more words: the most correct solution to the least weight match is to use a large number-the current edge weight, instead of directly performing Edge Weight inversion (this can only process completely bipartite graphs with equal left and right vertices, that is, K (n, n)

The above may be a bit of a problem.

Poj 1486-sorting slides (medium)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 1486
Question: required edges of a Bipartite Graph
Solution: To really understand the maximum matching algorithm, see the http://hi.baidu.com/kevin0602/blog/item/1d5be63b5bec9bec14cecb44.html

Poj 1904-King's Quest (medium, good question)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 1904
Question: Find all possible matching edges in a bipartite graph.
Solution: although the matching algorithm is not used in the end, you need to understand the idea of matching and convert it into a strongly connected component.

Poj 2060-Taxi Cab Scheme (basic)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 2060
Question: Minimum path coverage

Poj 2594-treasure accounting (moderate)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 2594
The minimum path that can be intersection is overwritten.
Solution: first pass the closure to convert

Poj 3041-Asteroids (basic)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 3041
Poj 2226-muddy fields (basic)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 2226
Question: Coverage of rows and columns
Solution: least point set coverage = maximum matching

Poj 2195-Going Home (basic)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 2195
Question: Minimum Weight Matching
Solution: Km Algorithm

Poj 2400-supervisor, supervisee (moderate)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 2400
Question: output all minimum weight matching
Solution: km, then trace back, sweat, and the two input matrices are reversed.

Poj 2516-minimum cost (moderate)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 2516
Question: minimum weight matching or minimum charge flow
Solution: Split point + km algorithm (only the correct one can pass) and Charge flow (the cost flow may pass through the wrong ms)

Poj 3686-The Windy's (hard)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 3686
Question: Minimum Weight Matching
Solution: Split the points, and use the KM algorithm to access the water. The data is actually very weak (50*50*2500)-> 16 Ms
Related: http://hi.baidu.com/kevin0602/blog/item/2829dc01d7143b087bec2c97.html

Spoj 412-K-path cover (difficult)
Https://www.spoj.pl/problems/COVER/
Question: omitted
Solution: a perfect match
Related: http://hi.baidu.com/roba/blog/item/c842fdfac10d24dcb48f31d7.html

Sgu 206. Roads (difficult)
Http://acm.sgu.ru/problem.php? C0 & proble m = 206
Solution: Typical questions. You can also use spoj 412 to optimize the questions.

NP problems
It is generally implemented by searching or DP.

Poj 1419-graph coloring (basic)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 1419
Question: Graph Coloring
Solution: search. Unfortunately, the data on the question is too weak.

Poj 2989-all friends (hard)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 2989
Question: The number of large groups
Solution: I started to get mad at tle. Later I found my thesis: finding all cliques of an undirected graph (Coen bron & joep kerboscht)

Zoj 1492-maximum clique (basic)
Http://acm.zju.edu.cn/show_problem.php? PID = 1, 1492
Question: the largest group of pictures
Solution: search. If the speed is required, refer to the corresponding paper.

Others
Not big class

Poj 1470-closest common ancestors (basic)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 1470
Question: LCA
Solution: Tarjan or rmq. The input is disgusting.

Poj 1985-cow Marathon (basic)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 1985
The longest path on the tree
Solution: DP

Poj 1986-distance queries (medium)
Http://acm.pku.edu.cn/JudgeOnline/problem? Id = 1986
Question: LCA
Solution: Tarjan or rmq

Hoj 11192-Justice leleague (interesting Graph Theory)
Http://acm.hnu.cn: 8080/online /? Action = problem & type = show & id = 11192 & courseid = 99

Hoj 11277-new island (interesting Graph Theory)
Http://acm.hnu.cn: 8080/online /? Action = problem & type = show & id = 11277> courseid = 109

This article from the csdn blog, reproduced please indicate the source: http://blog.csdn.net/logic_nut/archive/2009/08/27/4491326.aspx

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.