Skip to content

Instantly share code, notes, and snippets.

View farwydi's full-sized avatar

Leonid Zharikov farwydi

View GitHub Profile
@farwydi
farwydi / transport.py
Created November 25, 2018 22:05 — forked from bogdan-kulynych/transport.py
Transportation problem solver in Python
import numpy as np
from collections import Counter
def transport(supply, demand, costs):
assert sum(supply) == sum(demand)
s = np.copy(supply)
d = np.copy(demand)
C = np.copy(costs)