Software Design
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreSoftware Design

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 2nd, 2003, 07:03 AM
Ulaf Ulaf is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 1 Ulaf User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
maximum cardinality&weight matching

help!!!

anyone know of an algorithm that finds a maximum cardinality, maximum weight matching in a bipartite graph .

the meaning of maximum cardinality, maximum weight matching (or at least the meaining i'm giving to it) is to:
a. find a matching with a miximum number of edges
b. if more than one matching in step a exist - find the set with the maximum weight.

i know an algorithm exists (i've seen a LEDA header file with the function i described above) but i cant even reach a paper on this specific problem, not to speak of a pseudo-code.

thanks for anyone who gives a shot at this one,
Ulaf.

Reply With Quote
  #2  
Old March 4th, 2003, 11:53 AM
mrMister mrMister is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 2 mrMister User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
This is an NP problem (I think) so you'll have to try a back-tracking algorithm. Basicallly you'll have to test each combination until you reach a valid one or run out of possibilities.

ie

V1 = {a,b,c}
V2 = {d,e,f}

E = {(a,f,8),(a,e,10),(b,d,4),(b,e,6),(c,d,4)}

Have your app select the node with the smallest number of edges first. (c in this case) Select the largest edge from that node removing the edge and both nodes. Repeat with the node having the next least number of edges.

1 - (c,d,4) V1={a,b} V2 ={e,f}
2 - (c,d,4),(a,e,10) V1={b} V2 ={f}
-- no edge (b,f) so we rollback one
3 - (c,d,4),(b,d,4) V1={a} V2 ={f}
4 - (c,d,4),(b,d,4),(a,e,10) <-Valid Combo

I may be wrong though, I never was very good with algorithms...

Reply With Quote
  #3  
Old February 10th, 2004, 03:03 AM
crcp crcp is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Location: Paris
Posts: 16 crcp User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Talking MWM algorithm

Dear ULAF:
I am looking a simple code in c or c++ for doing the Maximum Weight Matching in bipartite graphs.

Did you found a good one?
I would appreciate if you could send me it.
Waiting for a favorable answer, please accept my best regards,
César

Reply With Quote
  #4  
Old February 10th, 2004, 09:50 AM
vanekl vanekl is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 229 vanekl User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
This is definitely not an NP problem; it can be solved
in polynomial time.
Check out Ford and Fulkerson's Max Flow algorithm.

Reply With Quote
  #5  
Old February 15th, 2004, 11:39 AM
dmack58 dmack58 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 2 dmack58 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 m 44 sec
Reputation Power: 0
An excellent book is "Combinatorial Optimization, Algorithms And Complexity" here is a link to it at amazon.com:

URL

I think it will answer many of your questions.

Reply With Quote
  #6  
Old January 28th, 2006, 02:28 AM
amitsinghvi amitsinghvi is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2006
Posts: 1 amitsinghvi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 m 48 sec
Reputation Power: 0
code for maximum weight matching

hi,
i've got a C code for maximum size cardinality matching in C using ford-fulkerson algorithm.if you want that i can give it to you.
if you got the C/C++ code for maximum weight matching in bipartite graph please send that to me also.
thanks
Quote:
Originally Posted by crcp
Dear ULAF:
I am looking a simple code in c or c++ for doing the Maximum Weight Matching in bipartite graphs.

Did you found a good one?
I would appreciate if you could send me it.
Waiting for a favorable answer, please accept my best regards,
César

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreSoftware Design > maximum cardinality&weight matching


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT