Problem 3277 : Workshops

Do you want to discuss about these problems? Go now!
Users are shared (no need to re-register).

Moderator: Board moderators

Post Reply
Learning poster
Posts: 78
Joined: Sun Jun 16, 2002 9:48 pm
Location: Cairo,Egypt

Problem 3277 : Workshops

Post by mido »

Any hints how to do this.... I tried to think of possible greedy algs, but each one seemed to have a snag...


Experienced poster
Posts: 216
Joined: Tue Aug 31, 2004 1:02 am
Location: Tehran

Post by Moha »

We solved it in contest by Graph matching.;)

New poster
Posts: 2
Joined: Mon Feb 05, 2007 4:07 am

Post by teamacm »

Moha wrote:We solved it in contest by Graph matching.;)
Do you mean weighted bipartite matching?

I've been attempting to implement this using Ford-Fulkerson and a modified Dijkstra (to avoid the problem of negative weighted edges). However, it is too slow: O(v^3) where v=1000.

Could you give details about how you solved it?

New poster
Posts: 1
Joined: Sun Feb 18, 2007 12:43 am


Post by ltdtl »

You can solve it using greedy alg.
it will take O(nlogn+rlogr+ nr).
if you make a good implementation, it will be reduced into O(xlogx), but it is not necessary (i guess).

New poster
Posts: 2
Joined: Mon Feb 05, 2007 4:07 am

Post by teamacm »

Could you please tell me what kind of greedy algorithm would solve it?

Posts: 519
Joined: Mon Jan 23, 2006 10:45 pm
Location: Vancouver, BC, Canada

Post by sclo »

Sort the workshop by some order (decreasing size, then increasing time).
Sort the rooms by another order (increasing time, then increasing capacity).

Greedily assign each workshop increasing order to the first available room.

New poster
Posts: 5
Joined: Thu Mar 08, 2007 4:33 am

Post by nbauernf »

I thought I could find a counter-example to your greedy choice, but I can't seem to find it at this moment.

Practicing for the world finals I wrote a greedy solution, and I ended up proving to myself that it cannot possibly be greedy (any choice of picking has a counter example). Maybe I didn't think about this choice... I'll go change my ordering to this and see if it works on my test set.


Learning poster
Posts: 67
Joined: Sat Jan 22, 2005 5:57 am

Re: Problem 3277 : Workshops

Post by rushel »

edit: can two workshop share the same room at the same time if the room has sufficient capacity

Post Reply

Return to “ACM ICPC Archive Board”