Code Examples
  Home arrow Code Examples arrow Bipartite Graphs
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
CODE EXAMPLES

Bipartite Graphs
By: Gabor Bernat
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2009-06-04

    Table of Contents:
  • Bipartite Graphs
  • The Problem
  • The Colorize Code Source
  • The Solution

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Bipartite Graphs


    (Page 1 of 4 )

    The economic crisis is upon us. You hear from radio, newspaper and television that we need to hold the line. You can no longer waste any of your time and money, because otherwise, the bankruptcy of your company is almost certain. In these harsh times, every little cent you can save is worth a fortune. If you have a company with various employees that can work in multiple places, but their production depends on what they are doing, and you want to maximize the company's productivity, you've come to the right place. This is the conclusion of a thirteen-part series that shows you how to use graphs and algorithms to solve everyday problems.

    Although at first glance the bipartite trait of graphs has nothing at common with your problem, if you think about it,  you will discover otherwise. All we need to do is rephrase the input data a little to get closer to your issue. So, let there be n workers that can work in a given number of machines/places.

    Of course, based on your experience, you know that each worker provides different levels of efficiency on each job. Therefore, it is crucial for you to make the assignments in a fashion such that your productivity will reach its maximum with your current team.

    Now consider that vertexes represent every job. We will name this group A. The assembly of the employees we will represent via nodes, and name them group B. A connection between these two groups matches the productivity of one with one assignment. Now, translating the problem to graph language will mean finding the maximum pairing (edges) that will result in n pairs.

    Of course, you may have more than n jobs or less than n employees. In this case, only the number of vertexes in each group will differ; the problem remains the same. Here it is a prime example of this:

    Image Courtesy of Grapy Theory Algorithms, Kátai Zoltán

     

    The first connection group (represented by the bold edges) offers two pairings, while the second is a little more efficient, offering three as the maximum. Now that you understand the issue before you, to venture any further I need to clarify what you must know to understand this article.

    This is part of a larger series about graphs; you will find all of the other articles here on the ASP Free web site. If you are not familiar with any of the concepts I'm about to enumerate, just search for the articles; you can even click on my name to find them all. Come back later, after you have read the articles explaining the concepts. You should understand how to represent graphs in memory, the breadth-first search and the Ford-Fulkerson Algorithm for network flows.

    More Code Examples Articles
    More By Gabor Bernat


     

    CODE EXAMPLES ARTICLES

    - Bipartite Graphs
    - Connectivity in Graphs
    - The Ford-Fulkerson Algorithm
    - Critical Paths
    - The Bellman-Ford and Roy-Floyd Algorithms
    - Shortest Path Algorithms in Graphs
    - Minimum Spanning Tree
    - Articulation Edges and Vertexes
    - Circles and Connectivity in Graphs
    - Depth-First Search in Graphs
    - Breadth-First Search in Graphs
    - The Prufer Code and the Floyd-Warshall Algor...
    - An Insight into Graphs
    - Coding a Custom Object with WSC
    - Creating a Custom Object with WSC





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek