Transportation problem: Difference between revisions
m
→{{header|REXX}}: added wordsort. thanx
(→{{header|REXX}}: flagged as needing improvement, there is a missing subroutine.) |
Walterpachl (talk | contribs) m (→{{header|REXX}}: added wordsort. thanx) |
||
Line 3,910:
=={{header|REXX}}==
<lang rexx>/* REXX ***************************************************************
* Solve the Transportation Problem using Vogel's Approximation
Line 4,118 ⟶ 4,115:
Say ol
End
Return
wordsort: Procedure
/**********************************************************************
* Sort the list of words supplied as argument. Return the sorted list
**********************************************************************/
Parse Arg wl
wa.=''
wa.0=0
Do While wl<>''
Parse Var wl w wl
Do i=1 To wa.0
If wa.i>w Then Leave
End
If i<=wa.0 Then Do
Do j=wa.0 To i By -1
ii=j+1
wa.ii=wa.j
End
End
wa.i=w
wa.0=wa.0+1
End
swl=''
Do i=1 To wa.0
swl=swl wa.i
End
/* Say swl */
Return strip(swl)</lang>
{{out}}
<pre>Sources / Demands / Cost
|