Notification texts go here Contact Us Buy Now!

Minimum Cost Maximum Flow Algorithm with restrictions

Minimum Cost Maximum Flow Algorithm with Restrictions

The minimum cost maximum flow algorithm with restrictions is a variant of the maximum flow problem that takes into account the cost of sending flow through edges. The goal is to find a flow that maximizes the total flow while minimizing the total cost.

Algorithm

LOOP until stop
Loop over servers
  SET closest = NULL
  SET shortest = INFINITY
  Loop over clients 
     IF client has server
         CONTINUE
     SET dist = distance from client to server
     IF dist < shortest
       SET closest = client
       SET shortest = dist
  ENDLOOP over clients
  IF closest == NULL
       STOP
  Connect closest client to server
ENDLOOP over servers
ENDLOOP until stop

Example

Consider the following example:
  • There are 3 servers and 5 clients.
  • The cost of sending flow from a server to a client is given by the following matrix:
| | Client 1 | Client 2 | Client 3 | Client 4 | Client 5 | |---|---|---|---|---|---| | Server 1 | 1 | 2 | 3 | 4 | 5 | | Server 2 | 6 | 7 | 8 | 9 | 10 | | Server 3 | 11 | 12 | 13 | 14 | 15 | The minimum cost maximum flow is 15 and the corresponding flow is: | Server | Client 1 | Client 2 | Client 3 | Client 4 | Client 5 | |---|---|---|---|---|---| | Server 1 | 1 | 2 | 3 | 4 | 5 | | Server 2 | 6 | 7 | 8 | 9 | 10 | | Server 3 | 11 | 12 | 13 | 14 | 15 |

Post a Comment

Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.