Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def setprice(n,p):
- price[n] = p
- def getprice(n):
- return price[n]
- def isDistributor(n):
- return getprice(n) != -1
- def print_min_distributore(mat,n):
- minimo = mat[n][0]
- nodo_minimo = 0
- for i in range(len(mat[n])):
- if isDistributor(n):
- if minimo > mat[n][i]:
- minimo = mat[n][i]
- nodo_minimo = i
- elif minimo == mat[n][i] and getprice(nodo_minimo) > getprice(i):
- minimo = mat[n][i]
- nodo_minimo = i
- print(n, nodo_minimo, minimo, getprice(nodo_minimo))
- def es2(G):
- mat = floyd(G)
- for i in range(len(mat)):
- if not isDistributor(n): #acquirente
- print_min_distributore(mat,i)
Advertisement
Add Comment
Please, Sign In to add comment