Transportation problem: Difference between revisions
Content added Content deleted
(added pascal implementation) |
|||
Line 921: | Line 921: | ||
Sb:longint=0; |
Sb:longint=0; |
||
Type |
Type points=Array [1..N] of longint; |
||
distribution=Array [1..N,1..N] of longint; |
|||
Var A,B,alfa,beta,B_d,x: |
Var A,B,alfa,beta,B_d,x:points; |
||
c,p: |
c,p:distribution; |
||
f,f0,x_min,Sp:longint; |
f,f0,x_min,Sp:longint; |
||
Nt,x_p,r,r_min,ki,kj,Na,Nb,h,l,i,j:byte; |
Nt,x_p,r,r_min,ki,kj,Na,Nb,h,l,i,j:byte; |
||
Line 931: | Line 931: | ||
u:Array[1..N*N] of byte; |
u:Array[1..N*N] of byte; |
||
Procedure Nul (var a: |
Procedure Nul (var a:points); |
||
var i:byte; |
var i:byte; |
||
Begin |
Begin |
||
Line 1,042: | Line 1,042: | ||
End; |
End; |
||
Procedure EnterIntoTheTable (var a: |
Procedure EnterIntoTheTable (var a:points; b:byte; c:char); { Entering into the table } |
||
var i,l,m:byte; |
var i,l,m:byte; |
||
Begin |
Begin |
||
Line 1,076: | Line 1,076: | ||
Function CalculatingThePotentials:boolean; { Calculating the potentials } |
Function CalculatingThePotentials:boolean; { Calculating the potentials } |
||
var k,i,j:byte; |
var k,i,j:byte; |
||
Z_a,Z_b: |
Z_a,Z_b:points; |
||
d:boolean; |
d:boolean; |
||
Begin |
Begin |