max flow or max matching

Let's talk about algorithms!

Moderator: Board moderators

Post Reply
Mek
New poster
Posts: 12
Joined: Tue Jan 18, 2005 10:43 pm

max flow or max matching

Post by Mek »

please tell me some uva problems with max flow or max matching application to train my skill :)
gvcormac
Problemsetter & Reviewer
Posts: 194
Joined: Fri Mar 15, 2002 2:00 am
Contact:

Post by gvcormac »

10746 Crime Wave - The Sequel
670 The Dog Task
10511 Councilling
663 Sorting Slides
753 A plug for Unix
563 Crimewave
2354 What's in a name?
Adrian Kuegel
Guru
Posts: 724
Joined: Wed Dec 19, 2001 2:00 am
Location: Germany

Post by Adrian Kuegel »

and:
259 Software Allocation
820 Internet Bandwidth
10080 Gopher II
10092 The Problem with the Problemsetter
10122 Mysterious Mountain
10330 Power Transmission
10380 Shogi Tournament
10779 Collectors Problem
10804 Gopher Strategy
Mek
New poster
Posts: 12
Joined: Tue Jan 18, 2005 10:43 pm

Post by Mek »

Thanks, I'll try to solve them 8)
greco
New poster
Posts: 6
Joined: Sat Jul 31, 2004 6:04 pm
Contact:

Post by greco »

IMO max flow kicks ass :lol: so I started to solve this problems. I didn't have any trouble solving Software Allocation, but I haven't solved #563 Crimewave yet.

First I thought that there will be a graph with s*a vertices, the source will be connected to the banks and the vertices on the border will be connected to a destination. Finding a max flow on this graph means that there will not be 2 robbers going on the same road, but it doesn't stop them going through the same intersection, but on different routes.

Can anybody explain his/her solution? Thanks. 8)
Attitude is no substitute for competence.
misof
A great helper
Posts: 430
Joined: Wed Jun 09, 2004 1:31 pm

Post by misof »

greco wrote:First I thought that there will be a graph with s*a vertices, the source will be connected to the banks and the vertices on the border will be connected to a destination. Finding a max flow on this graph means that there will not be 2 robbers going on the same road, but it doesn't stop them going through the same intersection, but on different routes.
A standard trick to introduce capacity limits on vertices is to split each vertex v into two vertices v_1, v_2. All edges that lead to v will lead to v_1, all edges from v will leave from v_2. Add an edge from v_1 to v_2 with the capacity limit for the original vertex. (In this case the capacity of the new edge will be 1.)

Note that I don't know whether this algorithm really solves the problem you mention, I just answer your question on limiting the flow through vertices. :D
greco
New poster
Posts: 6
Joined: Sat Jul 31, 2004 6:04 pm
Contact:

Post by greco »

Thanks about the advice... I thought about something like this but the graph already has 2.500 nodes, and the length of the source is already... big. :D
I don't know if I can write the code with your advice... if I do write it I don't know if I can debug it... and if I debug it I don't know if it will fit the time constraint. :D

I was wondering if someone thought of another way to use the max flow...

Thanks anyway. :)
Attitude is no substitute for competence.
Post Reply

Return to “Algorithms”