
      SUBROUTINE RNET                                                   NET00010
C********************************************************************** NET00020
C                                                                       NET00030
C                           R  N  E  T                    VERSION 3.61  NET00041
C                                                         OCTOBER 1979  NET00050
C                                               REVISED DECEMBER 1979   NET00061
C           THE RUTGERS MINIMUM COST NETWORK FLOW SUBROUTINES           NET00070
C                                                                       NET00080
C                                                                       NET00090
C                MICHAEL D. GRIGORIADIS   AND   TAU HSU                 NET00100
C                                                                       NET00110
C                                                                       NET00120
C                  DEPARTMENT OF COMPUTER SCIENCE                       NET00130
C              HILL CENTER FOR MATHEMATICAL SCIENCES                    NET00140
C                RUTGERS UNIVERSITY - BUSCH CAMPUS                      NET00150
C                 NEW BRUNSWICK, NEW JERSEY, 08903                      NET00160
C                                                                       NET00170
C********************************************************************** NET00180
C                                                                       NET00190
C     RNET COPY NUMBER      :  3 6 1 0 2 6  ; VERSION 3.61 - 12/1979.   NET00201
C     DATE ISSUED           :  JANUARY 23, 1979                         NET00210
C     THIS COPY ISSUED TO   :  PROF. R. R. MEYER                        NET00220
C     ISSUED FOR USE ONLY AT:  COMPUTER CENTER                           ET00230
C                              UINV. OF WISCONSIN AT MADISON            NET00240
C                                                                       NET00250
C********************************************************************** NET00260
C                                                                       NET00270
C                        INTRODUCTION                                   NET00280
C                                                                       NET00290
C  RNET PROVIDES A NETWORK SPECIALIZATION OF THE REVISED SIMPLEX METHOD NET00300
C  FOR BOUNDED VARIABLES,  PRIMARILY DESIGNED FOR SOLVING MINIMUM-COST  NET00310
C  NETWORK-FLOW PROBLEMS OF THE FORM:                                   NET00320
C                                                                       NET00330
C  (MCNF):    MINIMIZE Z=C*X ;  SUBJECT TO: A*X=B  AND  0.LE.X.LE.H     NET00340
C                                                                       NET00350
C  WHERE C, X, H ARE N-VECTORS, B IS AN M-VECTOR, 'A' IS AN (M,N) NODE- NET00360
C  ARC INCIDENCE MATRIX, AND M, N ARE THE NUMBER OF NODES AND ARCS,     NET00370
C  RESPECTIVELY.  THE COLUMNS A(J) OF THE MATRIX 'A' HAVE ELEMENTS:     NET00380
C                                                                       NET00390
C                      1  IF ARC 'J' IS INCIDENT  TO  NODE 'I'          NET00400
C          A(I,J) =   -1  IF ARC 'J' IS INCIDENT FROM NODE 'I'          NET00410
C                      0  OTHERWISE.                                    NET00420
C                                                                       NET00430
C  ONE UNIT VECTOR IS APPENDED TO THE MATRIX 'A' IN ORDER TO BRING IT   NET00440
C  TO FULL RANK.  THIS COLUMN MAY BE VIEWED AS AN ARTIFICIAL ARC FROM   NET00450
C  A 'FICTITIOUS' NODE TO SOME NODE OF THE NETWORK.  THE ELEMENTS OF    NET00460
C  OF THE RIGHT-HAND-SIDE 'B' (WHICH MUST ADD UP TO ZERO), REPRESENT    NET00470
C  'EXOGENOUS FLOWS' AS FOLLOWS:                                        NET00480
C                                                                       NET00490
C          IF NODE 'I' IS A  'SINK' ('DEMAND') NODE, THEN B(I).LT.0     NET00500
C          IF NODE 'I' IS A 'SOURCE'('SUPPLY') NODE, THEN B(I).GT.0     NET00510
C          IF NODE 'I' IS A 'PURE TRANSSHIPMENT' NODE, THEN B(I)=0.     NET00520
C                                                                       NET00530
C  RNET REQUIRES THAT 'MCNF' IS GIVEN IN TERMS OF LIST FUNCTIONS RATHER NET00540
C  THAN IN ITS EXPLICIT FORM ABOVE.                                     NET00550
C                                                                       NET00560
C  SEVERAL OTHER PROBLEMS, SUCH AS TRANSSHIPMENT, TRANSPORTATION,       NET00570
C  ASSIGNMENT, SHORTEST PATH AND MAXIMUM FLOW, CAN ALSO BE SOLVED BY    NET00580
C  RNET, AS 'MCNF' PROBLEMS.  THIS VERSION OF RNET DOES NOT TAKE FULL   NET00590
C  ADVANTAGE OF THEIR SPECIAL STRUCTURE IN ORDER TO REDUCE STORAGE OR   NET00600
C  TO FURTHER IMPROVE ITS RUN EFFICIENCY.                               NET00610
C                                                                       NET00620
C  IN ADDITION TO OBTAINING SOLUTIONS TO THE ABOVE PROBLEMS, RNET       NET00630
C  INCORPORATES A NUMBER OF 'SERVICES'.  THESE MAY BE USED TO MANI-     NET00640
C  PULATE LINEAR FORMS, WITH VECTORS AND MATRICES, REQUIRING THE LISTS  NET00650
C  OR VECTORS REPRESENTING BASIC SOLUTIONS TO MCNF PROBLEMS, TO MODIFY  NET00660
C  THE ORIGINAL DATA, TO RESTART FROM THE CURRENT BASIC SOLUTION, TO    NET00670
C  PERFORM A SPECIFIED SIMPLEX ITERATION, TO PREPARE VARIOUS TYPES OF   NET00680
C  OUTPUT, ETC.  THEY ARE OFFERED IN ORDER TO ASSIST PRACTITIONERS      NET00690
C  AND RESEARCHERS IN THEIR WORK ON MCNF AND RELATED PROBLEMS.          NET00700
C                                                                       NET00710
C  RNET IS STRUCTURED AS A SET OF SUBROUTINES, ALL WRITTEN IN           NET00720
C  FORTRAN IV, WHICH CAN BE CALLED FROM USER-WRITTEN FORTRAN PROGRAMS   NET00730
C  OR SUBROUTINES.  IT WAS DEVELOPED AT THE COMPUTER SCIENCE            NET00740
C  DEPARTMENT, RUTGERS UNIVERSITY.  THIS VERSION IS A MATURE AND HIGHLY NET00750
C  EFFICIENT OUTGROWTH OF EARLIER VERSIONS, DEVELOPED IN GRADUATE       NET00760
C  COURSES BY M. D. GRIGORIADIS, AND USED SINCE 1972 AS INSTRUCTIONAL   NET00770
C  AND EXPERIMENTAL TOOLS.                                              NET00780
C                                                                       NET00790
C  RNET IMPLEMENTS THE REVISED SIMPLEX METHOD AS A SINGLE-PHASE,        NET00800
C  MULTIPLE-PASS 'GRADUAL PENALTY METHOD.' IN THE FIRST 'PASS,' AN      NET00810
C  ALL-ARTIFICIAL, ONE-LEVEL ROOTED TREE (BASIS) IS CONSTRUCTED AND A   NET00820
C  MILD PENALTY COST IS ASSIGNED TO ALL ARTIFICIAL ARCS.  SIMPLEX       NET00830
C  ITERATIONS ARE PERFORMED UNTIL AN OPTIMAL SOLUTION IS OBTAINED WITH  NET00840
C  RESPECT TO THE CURRENT PENALTY COST.  IF THERE ARE ARTIFICIAL ARCS   NET00850
C  WITH POSITIVE FLOW, THE PENALTY COST IS INCREASED, THE DUAL          NET00860
C  VARIABLES ARE RECOMPUTED AND SIMPLEX ITERATIONS ARE CONTINUED FOR    NET00870
C  THE SECOND 'PASS,' ETC.  THE METHOD TERMINATES WITH AN OPTIMAL       NET00880
C  SOLUTION WHEN ALL ARTIFICIALS HAVE ZERO FLOW, OR, PROVIDED THAT THE  NET00890
C  PENALTY COST IS SUFFICIENTLY LARGE, WITH AN INFEASIBLE SOLUTION (IF  NET00900
C  AN ARTIFICIAL HAS POSITIVE FLOW), OR WITH AN INFINITE SOLUTION       NET00910
C  (CAUSED BY A DIRECTED NEGATIVE CYCLE OF INFINITE CAPACITY).          NET00920
C                                                                       NET00930
C  RNET EMPLOYS ELABORATE MECHANISMS TO AVOID UNDETECTED COMPUTATIONAL  NET00940
C  ERRORS DUE TO OVERFLOW CONDITIONS IN INTEGER ARITHMETIC AND TO       NET00950
C  HANDLE CONDITIONS ARISING FROM LARGE PENALTY COSTS IN VIEW OF THE    NET00960
C  LIMITED INTEGER WORDLENGTH CAPABILITY OF ANY COMPUTER.               NET00970
C                                                                       NET00980
C  IN PERFORMING A SIMPLEX ITERATION, ARCS ARE SELECTED TO ENTER THE    NET00990
C  TREE BY AN ALMOST RANDOM, UNSOPHISTICATED PARTIAL PRICING STRATEGY   NET01000
C  (USING ORDINARY REDUCED COSTS), WHICH DOES NOT REQUIRE ANY           NET01010
C  PRESCRIBED ORDER OF THE INPUT ARC LIST.  IN THE CASE OF MAXIMUM FLOW NET01020
C  PROBLEMS, THIS STRATEGY IS MODIFIED BY INCORPORATING A STEEPEST EDGE NET01030
C  CRITERION.                                                           NET01040
C  ??                                                                   NET01050
C  EXPERIMENTATION WITH ALL FORTY 'NETGEN' TEST PROBLEMS (KLINGMAN,     NET01060
C  NAPIER AND STUTZ, 'MANAGEMENT SCIENCE', VOLUME 20, NUMBER 5, L974),  NET01070
C  INDICATES THAT RNET IS CONSIDERABLY MORE EFFICIENT THAN OTHER        NET01080
C  IMPLEMENTATIONS OF THE SIMPLEX METHOD REPORTED IN THE LITERATURE     NET01090
C  KNOWN TO THE AUTHORS.  SUPRISINGLY ATTRACTIVE EFFICIENCIES HAVE ALSO NET01100
C  BEEN EXPERIENCED WITH LARGE MAXIMUM FLOW PROBLEMS.                   NET01110
C                                                                       NET01120
C ********************************************************************* NET01130
C                                                                       NET01140
C                       USER'S AGREEMENT                                NET01150
C                                                                       NET01160
C  THE RNET USER AGREES TO THE FOLLOWING:                               NET01170
C                                                                       NET01180
C  1.  PROGRAM DISSEMINATION AND USAGE GUIDELINES:                      NET01190
C  -----------------------------------------------                      NET01200
C                                                                       NET01210
C  A. THIS VERSION OF RNET IS MADE AVAILABLE UNDER A LIMITED RELEASE.   NET01220
C     UPON REQUEST TO THE AUTHORS AT THE ABOVE ADDRESS, THE USER        NET01230
C     RECEIVES A COPY OF RNET, A SAMPLE CALLING PROGRAM AND DATA FOR    NET01240
C     SIX TEST CASES.  THESE ARE PROVIDED FREE OF CHARGE, EXCEPT FOR    NET01250
C     HANDLING AND POSTAGE.  BY REIMBURSING RUTGERS UNIVERSITY FOR      NET01260
C     THESE COSTS, THE USER DOES NOT ACQUIRE PROPERTY RIGHTS TO RNET.   NET01270
C                                                                       NET01280
C  B. TO THE BEST OF HIS ABILITY, THE USER WILL NOT ALLOW THE REPRO-    NET01290
C     DUCTION OR DISSEMINATION OF RNET.  EACH COPY OF RNET WILL BE      NET01300
C     USED AT THE COMPUTER INSTALLATION FOR WHICH IT WAS REQUESTED      NET01310
C     AND OBTAINED FROM THE AUTHORS.  WHEN NEEDED, ADDITIONAL COPIES    NET01320
C     OF RNET WILL BE OBTAINED FROM THE AUTHORS.  UNTIL FURTHER NOTICE, NET01330
C     THE AUTHORS WILL CONTINUE TO BE THE ONLY SOURCE OF CURRENT        NET01340
C     OR FUTURE VERSIONS OF RNET.                                       NET01350
C                                                                       NET01360
C  C. RESULTS OBTAINED BY RNET OR BY MODIFICATIONS OF RNET MAY BE       NET01370
C     FREELY PUBLISHED BY USERS PROVIDED THAT RNET IS REFERENCED AND    NET01380
C     ANY MODIFICATIONS TO IT ARE ADEQUATELY DESCRIBED.                 NET01390
C                                                                       NET01400
C  D. THE AUTHORS RETAIN THE OPTION OF RELAXING THESE GUIDELINES, OF    NET01410
C     ASSIGNING COPYRIGHT TO OTHERS, OR OF ARRANGING FOR THE DISSEMI-   NET01420
C     NATION OF RNET BY OTHER PERSONS OR ORGANIZATIONS.  THE USERS WILL NET01430
C     BE INFORMED OF ANY FUTURE CHANGES IN THE ABOVE GUIDELINES.        NET01440
C                                                                       NET01450
C  2.  LIMITATION OF RESPONSIBILITY AND/OR LIABILITY:                   NET01460
C  --------------------------------------------------                   NET01470
C                                                                       NET01480
C  A. THE AUTHORS WELCOME FEEDBACK FROM USERS.  TO THE EXTENT THAT      NET01490
C     THEIR TIME PERMITS, THEY INTEND TO RELEASE IMPROVED VERSIONS      NET01500
C     OF RNET.  HOWEVER, THE AUTHORS ARE UNDER NO OBLIGATION TO CREATE  NET01510
C     SUCH VERSIONS, TO CONTINUE HONORING REQUESTS FOR THE CURRENT      NET01520
C     VERSION, OR TO PROVIDE HELP, GUIDANCE, EDUCATION OR MAINTENANCE   NET01530
C     OF RNET TO ANY INDIVIDUAL OR ORGANIZATION.                        NET01540
C                                                                       NET01550
C  B. RUTGERS UNIVERSITY, THE DEPARTMENT OF COMPUTER SCIENCE OF         NET01560
C     RUTGERS UNIVERSITY, THE AUTHORS, OR ANY OTHER CURRENT OR FUTURE   NET01570
C     EMPLOYERS OF THE AUTHORS ARE UNDER NO OBLIGATION AND ASSUME NO    NET01580
C     RESPONSIBILITY OF ANY KIND FOR ANY ASPECT OF RNET.  NONE OF       NET01590
C     THESE PARTIES ARE LIABLE FOR ANY CLAIMS ARISING FROM THE          NET01600
C     DISSEMINATION, ACQUISITION, USE OR APPLICATION OF RNET BY ANY     NET01610
C     INDIVIDUAL OR ORGANIZATION.                                       NET01620
C                                                                       NET01630
C ********************************************************************* NET01640
C                                                                       NET01650
C                      USER'S INSTRUCTIONS                              NET01660
C                                                                       NET01670
C ********************************************************************* NET01680
C                                                                       NET01690
C                I. SOLVING 'MCNF' PROBLEMS:                            NET01700
C                                                                       NET01710
C                SUBROUTINE CALL:  CALL RNET                            NET01720
C                                                                       NET01730
C  INPUT ARGUMENTS (ALL PLACED IN COMMON BY THE USER):                  NET01740
C  ---------------------------------------------------                  NET01750
C                                                                       NET01760
C 1. THE FOLLOWING TEN SCALAR ARGUMENTS:                                NET01770
C                                                                       NET01780
C  BT   : NUMBER OF BITS COMPRISING ONE INTEGER WORD FOR THE COMPUTER   NET01790
C           USED FOR THIS RUN, E.G. FOR IBM 360/370: BT=32.   (INTEGER) NET01800
C  PT   : PROBLEM TYPE (=0: FOR ALL PROBLEMS 'MCNF', EXCEPT =1 FOR      NET01810
C           MAXIMUM FLOW PROBLEMS).  THIS PARAMETER IS USED INTERNALLY  NET01820
C           BY RNET TO IMPROVE THE PRICING STEP FOR MAX FLOW. (INTEGER) NET01830
C  M    : NUMBER OF NODES.                                    (INTEGER) NET01840
C  N    : NUMBER OF ARCS.                                     (INTEGER) NET01850
C  IRT  : NODE ID FOR ROOT OF ALL TREES (SET DEFAULT TO 1).   (INTEGER) NET01860
C  MXIT : MAXIMUM NUMBER OF MAJOR ITERATIONS (PIVOTS).        (INTEGER) NET01870
C  FRQ  : PRICING FREQUENCY OF ARCS FROM THE ARC LIST; IN % OF N.(REAL) NET01880
C           I.E., CANDIDATE ARCS TO ENTER THE BASIS ARE SELECTED        NET01890
C           BY SEARCHING OVER EVERY K-TH ARC FROM THE ARC LIST,         NET01900
C           WHERE 'K'=FRQ*N/100+0.5.  FOR EACH SIMPLEX ITERATION,       NET01910
C           THE STARTING ARC IS CHOSEN SEQUENTIALLY 1,...,K-1.          NET01920
C  P0   : CONSTANT PENALTY COST MULTIPLIER FOR ARTIFICIAL ARCS.  (REAL) NET01930
C  PBAR : BASE OF EXPONENTIAL MULTIPLIER TO P0 (MUST BE .GT.1.0) (REAL) NET01940
C  NCAND: NORMALLY SET TO 0.                                  (INTEGER) NET01950
C         OTHERWISE, IT SPECIFIES THE NUMBER OF ARCS (WHOSE INDICES     NET01960
C         ARE LISTED IN THE ARRAY 'PCAND; SEE (3) BELOW) WHICH ARE TO   NET01970
C         BE USED IN SELECTING (PRICING) AN ARC TO ENTER THE BASIS      NET01980
C         TREE.  IN THIS CASE, THE 'FRQ' GIVEN ABOVE IS ASSUMED TO BE   NET01990
C         IN PERCENT OF 'NCAND' RATHER THAN 'N'.                        NET02000
C                                                                       NET02010
C  NOTE:  THE SCALARS 'P0' AND 'PBAR' ARE USED INTERNALLY BY RNET TO    NET02020
C  -----  COMPUTE THE PENALTY COST 'NPE' FOR ARTIFICIAL ARCS AS:        NET02030
C                                                                       NET02040
C           'NPE' = (MAC-MIC)*CP + MIC  ;  IF MAC.NE.MIC                NET02050
C                 = CP*(IABS(MIC)+1)    ;  IF MAC = MIC,                NET02060
C                                                                       NET02070
C         WHERE THE COMPOSITE PENALTY MULTIPLIER 'CP'=P0 * (PBAR**PWR); NET02080
C         'PWR'=0,1,2,4,8,16,32,..., CORRESPONDINGLY FOR PASSES         NET02090
C         'PAS'=1,2,3,4,5, 6, 7,... OF THE 'GRADUAL PENALTY METHOD.'    NET02100
C         THIS METHOD STARTS WITH A GENTLE PENALTY COST 'NPE'.  AT THE  NET02110
C         CONCLUSION OF THE FIRST PASS, IF THERE ARE NO ARTIFICIAL ARCS NET02120
C         WITH POSITIVE FLOW, 'X' GIVES THE OPTIMAL SOLUTION.  ELSE,    NET02130
C         NPE AND THE DUAL VARIABLES ARE RECOMPUTED AND THE RUN IS      NET02140
C         CONTINUED FOR A SECOND PASS, ETC.  CLEARLY 'NPE' NEED NOT     NET02150
C         EXCEED (M-1)*MAGNC+1, AND THUS 'CP' IS BOUNDED ACCORDINGLY.   NET02160
C         'MIC','MAC' ARE THE MIN AND MAX OF THE GIVEN ARC COSTS, AND   NET02170
C         'MAGNC' IS THE MAXIMUM OF THEIR ABSOLUTE VALUES.  EXPERI-     NET02180
C         MENTATION WITH THE FORTY 'NETGEN' TEST PROBLEMS INDICATES     NET02190
C         P0=1.0, PBAR=1.5 RESULT IN REASONABLE EXECUTION TIMES.        NET02200
C         THE BEST CHOICE FOR FRQ DEPENDS ON THE CLASS OF PROBLEMS      NET02210
C         BEING SOLVED.  GENERALLY, FRQ SHOULD BE CHOSEN IN THE RANGE   NET02220
C         0.8-8.0%.  EXPERIMENTATION INDICATES THAT THE BEST FRQ VALUES NET02230
C         FOR TRANSPORTATION AND ASSIGNMENT PROBLEMS (NETGEN PROBLEMS   NET02240
C         1-15) ARE IN THE RANGE 1.2-3.2% (DEFAULT FRQ=2.1%), FOR       NET02250
C         'DIFFICULT' CAPACITATED MCNF PROBLEMS (PROBLEMS 16-27) IN     NET02260
C         THE RANGE 6.7-8.7% (DEFAULT FRQ=7.1%), FOR MEDIUM-SIZED       NET02270
C         (1000-2000 NODES) UNCAPACITATED MCNF PROBLEMS (PROB'S 28-35)  NET02280
C         IN THE RANGE 3.2-5.2% (DEFAULT FRQ=4.3%), AND FOR LARGE       NET02290
C         'EASY' MCNF PROBLEMS (PROBLEMS 36-40) IN THE RANGE 0.7-2.7%   NET02300
C         (DEFAULT FRQ=1.2%).  THE USER MAY WISH TO EXPERIMENT WITH     NET02310
C         MODIFIED VALUES FOR THESE PARAMETERS IN ORDER TO ARRIVE AT    NET02320
C         THE MOST EFFICIENT SETTING FOR A GIVEN CLASS OF PROBLEMS.     NET02330
C                                                                       NET02340
C 2. THE FOLLOWING FOUR N-LONG INTEGER ARRAYS SPECIFYING THE INPUT ARC  NET02350
C    LIST AND DATA, AND ONE M-LONG INTEGER ARRAY SPECIFYING THE EXOGE-  NET02360
C    NOUS FLOWS (I.E.'B' IN 'MCNF'), ON THE NODES OF THE GIVEN NETWORK: NET02370
C                                                                       NET02380
C   (IMPORTANT NOTE: NO SPECIFIC ORDER OF THE ARC LIST IS ASSUMED.)     NET02390
C                                                                       NET02400
C  FROM:                                                                NET02410
C  TO  : THE PAIR 'FROM(J), TO(J)' DEFINES THE 'J-TH DIRECTED ARC'.     NET02420
C                                                                       NET02430
C  C   : 'C(J)' IS THE 'COST PER UNIT FLOW' IN THE J-TH DIRECTED ARC.   NET02440
C                                                                       NET02450
C  H   : 'H(J)' IS THE POSITIVE 'CAPACITY' OF THE J-TH DIRECTED ARC.    NET02460
C          INFINITE CAPACITIES MUST INITIALLY BE ENTERED AS ZERO.  RNET NET02470
C          WILL AUTOMATICALLY SUBSTITUTE ALL SUCH H(I)=0 WITH THE LARGE NET02480
C          INTEGER H(I)=2**(BT-1)-1 TO REPRESENT INFINITE CAPACITIES.   NET02490
C                                                                       NET02500
C  X   : X(I).GT.0:'EXOGENOUS SUPPLY' AT 'SOURCE NODE' I;(B(I) IN MCNF).NET02510
C            .LT.0:'EXOGENOUS DEMAND' AT 'SINK NODE' I  ;(   ''   ''  ).NET02520
C            .EQ.0:'PURE TRANSSHIPMENT-NODE' I, WITH NO EXOGENOUS FLOW. NET02530
C                                                                       NET02540
C  NOTE: THE SUM OF EXOGENOUS SUPPLIES MUST EQUAL THE SUM OF EXOGENOUS  NET02550
C  ----- DEMANDS, AND THE MAGNITUDE OF EACH MUST NOT EXCEED 2**(BT-1)-1.NET02560
C                                                                       NET02570
C 3. OPTIONALLY, THE FOLLOWING K-LONG INTEGER ARRAY, WHERE  1.LE.K.LE.N NET02580
C    BUT WITH K.GE.MAX(1,NCAND) IS REQUIRED, MY BE DEFINED BY THE USER: NET02590
C                                                                       NET02600
C  PCAND: THE ARRAY PCAND(I), I=1,...,NCAND, CONTAINS THE INDICES J (IN NET02610
C         THE ARC LIST GIVEN IN (2) ABOVE) OF A SUBSET OF THE GIVEN     NET02620
C         ARCS. CLEARLY, 1.LE.PCAND(I).LE.N FOR I=1,...,NCAND.  THE     NET02630
C         SO-DEFINED SUBSET OF ARCS IS USED BY RNET TO SELECT AN        NET02640
C         'ENTERING' ARC IN THE PRICING STEP OF THE SIMPLEX METHOD.     NET02650
C                                                                       NET02660
C  NOTE:  WHEN CALLING 'RNCNT' OR 'RNREST' WITH AN EXISTING BASIS TREE, NET02670
C  -----  AND A GIVEN 'PCAND' LIST, EVERY ARC WHICH LEAVES THE BASIS    NET02680
C         TREE WILL REMAIN NONBASIC FROM THEN ON, UNLESS, THE 'PCAND'   NET02690
C         LIST CONTAINS ALL BASIS ARCS PRIOR TO CALLING THESE SUB-      NET02700
C         ROUTINES.  ARTIFICIAL ARCS CANNOT BE PLACED IN 'PCAND'.       NET02710
C                                                                       NET02720
C                                                                       NET02730
C  OUTPUT ARGUMENTS (ALL PLACED IN COMMON BY RNET; SEE NOTE BELOW):     NET02740
C  ----------------------------------------------------------------     NET02750
C                                                                       NET02760
C  1. COMPLETION CODES AND RUN STATISTICS:                              NET02770
C                                                                       NET02780
C  RTN(.) : COMPLETION CODES AND RUN STATISTICS (INTEGER). IF RTN(1)=0, NET02790
C             THEN OPTIMAL SOLUTION ACHIEVED (FOR DETAILS SEE PART IV). NET02800
C  RTT(1) : CPU TIME FOR DATA CHECKING AND INITIAL SOLUTION.     (REAL) NET02810
C  RTT(2) : CPU TIME SPENT ON THE SIMPLEX ALGORITHM.             (REAL) NET02820
C  MW     : MAXIMUM MAGNITUDE OF THE INTEGER OCCUPYING A FULL WORD OF   NET02830
C             'BT' BITS (E.G. FOR 32-BIT WORD MW=2147483647)  (INTEGER) NET02840
C  PAS    : NO. OF LAST PASS OF THE GRADUAL PENALTY METHOD.   (INTEGER) NET02850
C  CP     : THE LATEST COMPOSITE MULTIPLIER AS DEFINED ABOVE.    (REAL) NET02860
C                                                                       NET02870
C  2. FINAL SOLUTION:                                                   NET02880
C                                                                       NET02890
C  2.1. THE FINAL BASIS TREE T, AND THE FINAL BASIC SOLUTION IS GIVEN   NET02900
C         BY THE FOLLOWING SEVEN M-LONG INTEGER ARRAYS:                 NET02910
C                                                                       NET02920
C (*)F  : F(I) IS THE 'PREDECESSOR' ('FATHER') OF NODE I IN THE TREE T: NET02930
C    IF F(I)=0, NODE I IS THE ROOT NODE IRT.                            NET02940
C        .LT.0, THE BASIC ARC 'ARC(I)' IS FROM NODE 'I' TO NODE 'F(I)'. NET02950
C        .GT.0, THE BASIC ARC 'ARC(I)' IS FROM NODE 'F(I)' TO NODE 'I'. NET02960
C                                                                       NET02970
C (+)P  : PREORDER TRAVERSAL SEQUENCE FUNCTION. P(I) IS THE NODE TO BE  NET02980
C         TRAVERSED AFTER NODE I. P IS A CIRCULAR-PREORDER ARRAY, I.E.  NET02990
C         THE LAST NODE IN THE PREORDER LIST POINTS BACK TO 'IRT'.      NET03000
C                                                                       NET03010
C (+)R  : REVERSE-PREORDER TRAVERSAL SEQUENCE FUNCTION. I.E. R(I)=J IF  NET03020
C           AND ONLY IF  I=P(J) FOR ALL NODES I AND J.  THIS ARRAY IS   NET03030
C           USED TO IMPROVE THE EFFICIENCY OF THE PIVOT STEP FOR CALLS  NET03040
C           RNET, RNREST AND RNCNT.  IF STORAGE SAVING IS OF OVERRIDING NET03050
C           CONCERN, IT MAY BE REMOVED (PROVIDED THAT THE INDICATED     NET03060
C           CHANGES IN SUBROUTINE RNPIVT ARE ALSO MADE).  THIS ARRAY IS NET03070
C           ALSO USED IN SOME USER-SERVICE CALLS.                       NET03080
C                                                                       NET03090
C (+)D  : D(I) IS THE DEPTH OF NODE I IN BASIS TREE. (NOTE: D(IRT)=0)   NET03100
C                                                                       NET03110
C (+)ARC: ARC(I) IS THE SEQUENTIAL ARC INDEX (IN THE INPUT ARC LIST) OF NET03120
C          THE I-TH BASIC ARC, I.E. ARC(I) IS THE ARC ASSOCIATED WITH   NET03130
C          NODE 'I' OF THE TREE T.  ARC(I)=0 INDICATES THAT THE         NET03140
C          I-TH BASIC ARC IS AN ARTIFICIAL ARC.                         NET03150
C                                                                       NET03160
C (*)X  : X(I) IS THE FLOW ON THE I-TH BASIC ARC.                       NET03170
C                                                                       NET03180
C (*)U  : U(I) IS THE DUAL VARIABLE ASSOCIATED WITH NODE I.             NET03190
C                                                                       NET03200
C  NOTE: ARRAYS MARKED (*) SUFFICE TO DESCRIBE THE SOLUTION.  ARRAYS    NET03210
C        MARKED (+) GIVE ADDITIONAL INFORMATION ON THE TREE STRUCTURE.  NET03220
C                                                                       NET03230
C  2.2. THE FINAL FLOW-SATURATED NONBASIC ARCS ARE INDICATED BY         NET03240
C         NEGATING THEIR GIVEN CAPACITIES H(.).                         NET03250
C                                                                       NET03260
C   NOTE: RNET MODIFIES THE ORIGINAL ARRAYS 'H' AND 'X'.  THE ORIGINAL  NET03270
C   ----   'H' CAN BE RESTORED BY SETTING : H(J)=IABS(H(J)) FOR J=1,N.  NET03280
C          TO RESTORE THE ORIGINAL 'X' (I.E. THE 'B' OF 'MCNF'), AN     NET03290
C          M-LONG ARRAY OF USER STORAGE IS NEEDED TO SAVE 'B'.          NET03300
C                                                                       NET03310
C ********************************************************************* NET03320
C                                                                       NET03330
C              II. RESTART FACILITIES:                                  NET03340
C                                                                       NET03350
C  1.  RESTARTING WITH REVISED PROBLEM DATA:                            NET03360
C                                                                       NET03370
C  THE USER CAN REVISE EXOGENOUS FLOWS, COSTS, CAPACITIES, CAN APPEND   NET03380
C  NEW ARCS AT THE END OF THE ARC LIST, AND CAN SOLVE THE SO-REVISED    NET03390
C  PROBLEM FROM THE PREVIOUSLY OBTAINED BASIS TREE.  APPENDING NEW ARCS NET03400
C  DICTATES INCREASING THE VALUE OF 'N' (SEE VI FOR MAXIMUM INCREASE).  NET03410
C                                                                       NET03420
C  REVISION OF PROBLEM DATA IS ACCOMPLISHED BY THIS SEQUENCE OF CALLS:  NET03430
C                                                                       NET03440
C CALL RNREV          : INITIALIZATION FOR REVISION OF DATA.            NET03450
C                                                                       NET03460
C CALL RNRVCJ(J,JDEL) : ADDS JDEL TO COST OF ARC J, IE. C(J)=C(J)+JDEL. NET03470
C                                                                       NET03480
C CALL RNRVCV(N,JDELV): ADDS CHANGE-VECTOR 'JDELV' TO C, I.E. C=C+JDELV NET03490
C                                                                       NET03500
C CALL RNRVBI(I,IDEL) : ADDS IDEL TO THE EXOGENOUS FLOW ('B' IN MCNF)   NET03510
C        AT NODE 'I', I.E. UPDATES PROBLEM TO EFFECT  B(I)=B(I)+IDEL.   NET03520
C                                                                       NET03530
C CALL RNRVBV(M,IDELV): ADDS CHANGE-VECTOR'IDELV' TO 'B', IE. B=B+IDELV NET03540
C                                                                       NET03550
C CALL RNRVHJ(J,JDEL) : ADDS JDEL TO CAPCTY OF ARC J, IE.H(J)=H(J)+JDEL NET03560
C                                                                       NET03570
C CALL RNRVHV(N,JDELV): ADDS CHANGE-VECTOR 'JDELV' TO H, I.E. H=H+JDELV NET03580
C                                                                       NET03590
C NOTES: OMIT ANY OF THE ABOVE SIX CALLS IF NO APPLICABLE CHANGES EXIST.NET03600
C        CALLS TO RNRVCV, RNRVHV REQUIRE AN N-LONG INTEGER VECTOR JDELV NET03610
C        TO BE DECLARED IN THE USER'S CALLING PROGRAM.  CALLS TO RNRVBV NET03620
C        REQUIRE M-LONG INTEGER VECTOR IDELV TO BE SIMILARLY DECLARED.  NET03630
C                                                                       NET03640
C CALL RNREST         : RESTARTS THE SIMPLEX ALGORITHM FROM THE         NET03650
C        PREVIOUSLY OBTAINED BASIS AND FROM THE CURRENTLY DEFINED 'P0'  NET03660
C        AND 'PBAR'.  'PAS'=0 WILL AUTOMATICALLY BE RESET BY 'RNREST'.  NET03670
C        THE USER MAY REDEFINE P0 AND/OR PBAR PRIOR TO THIS CALL.       NET03680
C                                                                       NET03690
C  OUTPUT OF 'RNREST' IS THE SAME AS THAT OF 'RNET' (SEE PART I. ABOVE).NET03700
C                                                                       NET03710
C  2.  RESTARTING FROM SAME PROBLEM DATA & FROM LAST BASIC SOLUTION:    NET03720
C                                                                       NET03730
C CALL RNCNT(ITA)     : 'CONTINUES' RNET ITERATIONS UP TO A MAXIMUM OF  NET03740
C        'MXIT+ITA'.  THIS CALL INCREASES 'MXIT' BY THE AMOUNT 'ITA',   NET03750
C        BUT DOES NOT RESET ANY OTHER RUN PARAMETERS.                   NET03760
C                                                                       NET03770
C ********************************************************************  NET03780
C                                                                       NET03790
C               III. ADDITIONAL USER SERVICE TASKS:                     NET03800
C                                                                       NET03810
C  1. CALL RNOBJI     : COMPUTES THE EXACT INTEGER VALUE OF THE         NET03820
C        OBJECTIVE FUNCTION Z=C*X.  THE CALL MAY BE ISSUED ONLY AFTER   NET03830
C        RNET, RNREST OR RNCNT.                                         NET03840
C     INPUT ARGUMENTS : NONE                                            NET03850
C     OUTPUT ARGUMENTS: RTN(2), RTN(3), SUCH THAT Z=RTN(2)+RTN(3)*MW,   NET03860
C        I.E. RTN(2)=Z MODULO MW; RTN(3)=INT(Z/MW).                     NET03870
C        RTN(10)= NUMBER OF SATURATED ARCS (BASIC AND NONBASIC).        NET03880
C        RTN(11)= NUMBER OF BASIC ARTIFICIALS WITH POSITVE FLOW.        NET03890
C                                                                       NET03900
C  2. CALL RNOBJR(ZR) : COMPUTES THE OBJECTIVE FUNCTION VALUE ZR=C*X    NET03910
C        AS A REAL VARIABLE 'ZR'.  ALTHOUGH THIS CALL IS FASTER THAN    NET03920
C        'RNOBJI', IT MAY PRODUCE ONLY AN APPROXIMATE VALUE FOR LARGE   NET03930
C        COSTS AND/OR FLOWS. (MAY BE CALLED ONLY AFTER RNET, RNREST     NET03940
C        OR RNCNT)                                                      NET03950
C     INPUT ARGUMENTS : NONE                                            NET03960
C     OUTPUT ARGUMENTS: 'ZR', THE VALUE OF C*X.  ALSO, RTN(2)=RTN(3)=0, NET03970
C        AND RTN(10),RTN(11) AS IN 'RNOBJI' ABOVE.                      NET03980
C                                                                       NET03990
C  3. CALL RNFTNI(NODES,VI,VO): COMPUTES: (VO)=(BASIS INVERSE)*(VI)     NET04000
C     INPUT ARGUMENTS : 'VI', AN M-LONG INTEGER INPUT VECTOR.           NET04010
C        'NODES' (MUST BE M, OR NODES=M DEFINED PRIOR TO THIS CALL).    NET04020
C     OUTPUT ARGUMENTS: 'VO', THE M-LONG INTEGER OUTPUT VECTOR.  WHEN   NET04030
C        THE SUM OF THE ABSOLUTE VALUES OF THE ELEMENTS OF 'VI' EXCEEDS NET04040
C        'MW', ONE OR MORE ELEMENTS OF 'VO' MAY BE IN ERROR DUE TO      NET04050
C        TRUNCATION WHICH MAY OCCUR IN INTEGER ARITHMETIC.              NET04060
C                                                                       NET04070
C  4. CALL RNFTNR(NODES,RVI,RVO) : AS 'RNFTNI' BUT FOR REAL M-VECTORS.  NET04080
C                                                                       NET04090
C  5. CALL RNCOL(JCOL,VO): COMPUTES THE 'JCOL'-TH COLUMN OF THE INVERSE.NET04100
C     INPUT ARGUMENTS : COLUMN INDEX 'JCOL'  (1 TO M).                  NET04110
C     OUTPUT ARGUMENTS: 'VO', THE M-LONG COLUMN 'JCOL' OF THE INVERSE,  NET04120
C        WHOSE ELEMENTS VO(K) REPRESENT THE 'NODE-TO-ROOT' PATH         NET04130
C        'NRP(JCOL)' FROM NODE 'JCOL' TO THE ROOT AS FOLLOWS:           NET04140
C                                                                       NET04150
C                     1   IF ARC 'K' IS ON NRP(JCOL) AND ITS            NET04160
C                           DIRECTION IS OPPOSITE TO NRP(JCOL).         NET04170
C          VO(K) =   -1   IF ARC 'K' IS ON NRP(JCOL) AND ITS            NET04180
C                           DIRECTION COINCIDES WITH NRP(JCOL).         NET04190
C                     0   OTHERWISE.                                    NET04200
C                                                                       NET04210
C  6. CALL RNFAP(JARC,NC,VO): COMPUTES THE EXPLICIT FAP(JARC) IN 'VO'.  NET04220
C     INPUT ARGUMENTS : 'JARC',AN ARC INDEX FROM THE ARC LIST (1 TO N). NET04230
C     OUTPUT ARGUMENTS: 'NC', THE FIRST COMMON NODE OF THE TWO PATHS    NET04240
C        FROM EACH END OF ARC 'JARC' TOWARD THE ROOT.                   NET04250
C        'VO', THE M-LONG EXPLICIT FAP(JARC), WHERE:                    NET04260
C                                                                       NET04270
C                     1   IF ARC 'L' IS ON FAP(JARC) AND ITS            NET04280
C                           DIRECTION IS OPPOSITE TO FAP(JARC)          NET04290
C          VO(L) =   -1   IF ARC 'L' IS ON FAP(JARC) AND ITS            NET04300
C                           DIRECTION COINCIDES WITH FAP(JARC)          NET04310
C                     0   OTHERWISE.                                    NET04320
C                                                                       NET04330
C  7. CALL RNBTNI(NODES,VI,VO): COMPUTES (VO)=(VI)*(BASIS INVERSE).     NET04340
C        THE INPUT/OUTPUT ARGUMENTS ARE THE SAME AS FOR RNFTNI ABOVE.   NET04350
C        ALSO, NOTE THE COMMENTS REGARDING THE ACCURACY OF 'VO'.        NET04360
C                                                                       NET04370
C  8. CALL RNBTNR(NODES,RVI,RVO): AS 'RNBTNI' BUT FOR REAL M-VECTORS.   NET04380
C                                                                       NET04390
C  9. CALL RNROW(IROW,VO):   COMPUTES 'IROW'-TH ROW OF THE INVERSE.     NET04400
C     INPUT ARGUMENTS : ROW INDEX 'IROW'  (1 TO M)                      NET04410
C     OUTPUT ARGUMENTS: 'VO',THE M-LONG ROW 'IROW' OF THE INVERSE,WHERE NET04420
C                                                                       NET04430
C          VO(L) =  'S'  IF NODE 'L' IS IN THE SUBTREE 'T2'             NET04440
C                    0   OTHERWISE                                      NET04450
C        WITH                                                           NET04460
C             'S'=  -1   IF THE ARC CORRESPONDING TO 'IROW' IS          NET04470
C                          DIRECTED AWAY FROM THE ROOT                  NET04480
C                    1   OTHERWISE.                                     NET04490
C                                                                       NET04500
C        THE SUBTREE 'T2' REFERS TO THE SUBTREE OF THE BASIS TREE, NOT  NET04510
C        CONTAINING THE ROOT NODE, WHICH WOULD BE CREATED WHEN THE      NET04520
C        ARC CORRESPONDING TO 'IROW' IS CUT.                            NET04530
C                                                                       NET04540
C 10. CALL RNSTEP(INA,LVA): PERFORMS ONE SIMPLEX ITERATION.  IT CAN BE  NET04550
C        CALLED ONLY AFTER RNET, RNREST, OR RNCNT.                      NET04560
C     INPUT ARGUMENTS : 'INA',INDEX OF NONBASIC ARC TO ENTER TREE (1-N).NET04570
C     OUTPUT ARGUMENTS: 'LVA',INDEX OF ARC WHICH LEFT TREE, (1-N).      NET04580
C        IF LVA = 0, AN ARTIFICIAL ARC LEFT THE TREE.                   NET04590
C        IF LVA =-1, NO ARC LEFT THE TREE ('INA' REMAINS NONBASIC BUT   NET04600
C                    AT ITS OPPOSITE BOUND).                            NET04610
C        IF LVA = MW, THEN FAP(INA) SATURATES ONE OR MORE ARCS OF GIVEN NET04621
C                    INFINITE CAPACITY (ASSUMED AS MW).  IF ALL ARCS IN NET04631
C                    THE CYCLE HAVE INFINITE CAPACITIES AND THE TOTAL   NET04641
C                    CYCLE COST IS NEGATIVE,AN INFINITE SOL'N IS REACHEDNET04651
C                                                                       NET04660
C 11. CALL RNBPRL(I):  PREPARES PRINT LINE FOR THE I-TH BASIC ARC:      NET04670
C     THE USER'S CALLING PROGRAM CAN USE THIS FACILITY TO PRINT A LINE  NET04680
C     IN ANY DESIRED FORMAT, E.G.'WRITE(6,100)LPR' FOR SOME FORMAT 100. NET04690
C     INPUT ARGUMENTS :'I' (I.E. THE I-TH BASIC ARC; I=1 TO M)          NET04700
C     OUTPUT ARGUMENTS:(IN INTEGER ARRAY LPR IN COMMON):                NET04710
C                                                                       NET04720
C   LPR(1): 'I'(NODE OF I-TH BASC ARC); LPR(6) : PREORDER P(I).         NET04730
C   LPR(2): ARC ID, THE ARC JOINING   ; LPR(7) : DEPTH D(I).            NET04740
C             NODES 'F(I) AND 'I'.    ; LPR(8) : DUAL VALUE FOR NODE'I' NET04750
C   LPR(3): 'FROM' NODE OF 'LPR(2)'.  ; LPR(9) : FLOW IN ARC 'LPR(2)'.  NET04760
C   LPR(4): 'TO' NODE OF LPR(2).      ; LPR(10): CAPCTY OF ARC 'LPR(2)' NET04770
C   LPR(5): 1 (INDICATES BASIC ARC).  ; LPR(11): CST/UNIT FLO OF LPR(2) NET04780
C                                       LPR(12): LPR(9)*LPR(11). (NOTE: NET04790
C                                           LPR(12) MAY BE INACCURATE.) NET04800
C                                                                       NET04810
C 12. CALL RNAPRL(J):       PREPARES PRINT LINE FOR ARC 'J'.            NET04820
C     INPUT ARGUMENTS :'J'(I.E. THE GIVEN ARC ID; 1 TO N).              NET04830
C     OUTPUT ARGUMENTS:(IN INTEGER ARRAY 'LPR' IN COMMON):              NET04840
C                                                                       NET04850
C   LPR(1):     0       IF 'J'NONBASC; LPR(6) : P(LPR(1))  IF 'J' BASIC NET04860
C         BASIC-NODE-ID IF 'J'BASIC  ; LPR(7) : D(LPR(1))  IF 'J' BASIC NET04870
C                                    ; LPR(8) : U(LPR(1))  IF 'J' BASIC NET04880
C   LPR(2): ARC ID 'J'.              ;          REDCD-CST, IF J NONBASC NET04890
C   LPR(3): 'FROM' NODE OF ARC 'J'.  ; LPR(9) : FLOW IN ARC 'J'.        NET04900
C   LPR(4): 'TO' NODE OF ARC 'J'.    ; LPR(10): CAPACITY OF ARC 'J'.    NET04910
C   LPR(5): 0  IF 'J' IS NONBASIC    ; LPR(11): CST/UNIT FLOW OF 'J'.   NET04920
C           1  IF 'J' IS BASIC       ; LPR(12): LPR(9)*LPR(11)  (NOTE:  NET04930
C                                           LPR(12) MAY BE INACCURATE.) NET04940
C                                                                       NET04950
C  FORMATTED PRINTING FACILITIES (ON UNIT 'IOUT'; MIN.REC. LENGTH=112): NET04960
C                                                                       NET04970
C 13. CALL RNWIPA(IOUT):   PRINTS INITIAL RUN-PARAMETER SETTINGS AND    NET04980
C        ALSO RESETS CP=0.0, AND PAS=0.                                 NET04990
C                                                                       NET05000
C 14. CALL RNWFPA(IOUT):   PRINTS FINAL RUN-PARAMETER SETTINGS, RETURN  NET05010
C        CODES (RTN) AND EXECUTION TIMES (RTT).                         NET05020
C                                                                       NET05030
C 15. CALL RNWSOL(IOUT,IB,IAT,IFL,JFA,JTA,JFN,JTN,NHITS):               NET05040
C        PRINTS SOLUTION REPORT VIA SELECTION LISTS:                    NET05050
C      INPUT ARGUMENTS:                                                 NET05060
C         'IOUT': OUTPUT UNIT NUMBER,                                   NET05070
C          'IB' : =1 BASIC ARCS; =2 ALL ARCS; =3 NONBASIC  ARCS.        NET05080
C          'IAT': =1 GIVEN & ARTFCL ARCS; =2 GIVEN ARCS; =3 ARTFL ARCS. NET05090
C          'IFL': =1 AT ANY FLOW; =2 AT ZERO FLOW; =3 AT POSITIVE FLOW; NET05100
C                          =4 AT SATURATED  FLOW.                       NET05110
C          'JFA,JTA': ARCS WITH ARC-IDS IN THE RANGE 'JFA' TO 'JTA'.    NET05120
C                         (NOTE: 1.LE.JFA.LE.JTA.LE.N ).                NET05130
C          'JFN,JTN': ARCS INVOLVING NODES WITH ID'S IN RANGE 'JFN' TO  NET05140
C                         'JTN' ( 1.LE.JFN.LE.JTN.LE.M).                NET05150
C     OUTPUT ARGUMENTS:   'NHITS', NUMBER OF ARCS SELECTED AND PRINTED  NET05160
C          ON OUTPUT UNIT 'IOUT'.                                       NET05170
C                                                                       NET05180
C  NOTE:  THE INPUT ARGUMENTS IB,...,JTN ABOVE AFFECT THE AMOUNT AND    NET05190
C  ORDER OF THE SOLUTION REPORT. JUDICIOUS USE OF THESE IS RECOMMENDED. NET05200
C  FOR INSTANCE, FOR A PROBLEM WITH M=5000, N=25000, AN RNET SOLUTION   NET05210
C  WITH 4000 DEGENERATE BASIC ARCS AND WITH RTN(10)=200, THE CALL:      NET05220
C                 CALL RNWSOL(IOUT,1,1,1,1,N,1,M,NHITS)                 NET05230
C  WILL PRODUCE 30,000 LINES OF PRINT (NHITS=30000), WHEREAS THE CALL:  NET05240
C                 CALL RNWSOL(IOUT,2,2,3,1,N,1,M,NHITS)                 NET05250
C  WILL PRODUCE EXACTLY 1200 LINES OF PRINT (NHITS=1200), FOR ALL ARCS  NET05260
C  WITH POSITIVE FLOW, IN INCREASING ARC-INDEX SEQUENCE.                NET05270
C                                                                       NET05280
C ********************************************************************* NET05290
C                                                                       NET05300
C                IV. COMPLETION CODES AND RUN STATISTICS:               NET05310
C                                                                       NET05320
C               (RETURNED IN INTEGER ARRAY RTN IN COMMON)               NET05330
C                                                                       NET05340
C 1. NORMAL TERMINATIONS:                                               NET05350
C    RTN(1)= 0: OPTIMAL SOLUTION ACHIEVED. (IF 'PCAND' WAS IN EFFECT,   NET05360
C               I.E. IF NCAND.GT.0, THIS OPTIMAL SOLUTION IS ACHIEVED   NET05361
C               ONLY WITH RESPECT TO THE ARCS WHICH ARE IN 'PCAND'.    NET05362
C          =10: NO FEASIBLE SOLUTION (NFS) EXISTS.                      NET05370
C          =20: NFS DECLARED BECAUSE ANY FURTHER INCREASE IN THE FINAL  NET05380
C                COMPOSITE PENALTY MULTIPLIER 'CP' MIGHT CAUSE INTEGER  NET05390
C                ARITHMETIC OVERFLOW.  THUS, THE GIVEN PROBLEM IS       NET05400
C                EITHER INFEASIBLE, OR THE RANGE OF THE GIVEN ARC COSTS NET05410
C                ARE TOO LARGE FOR THE INTEGER WORDLENGTH 'BT'.         NET05420
C          =30: INFINITE SOLUTION DECLARED.  THIS IS CAUSED WHEN A      NET05430
C                DIRECTED CYCLE, COMPOSED OF ARCS OF INFINITE CAPACITY, NET05440
C                AND OF NEGATIVE TOTAL UNIT COST, IS ENCOUNTERED AS A   NET05450
C                FLOW-AUGMENTING PATH 'FAP(KARC)'.  THE RELEVANT        NET05460
C                RESULTS FOR THIS CASE ARE GIVEN AS FOLLOWS:            NET05470
C                 RTN(2)='KARC' THE ENTERING ARC INDEX.                 NET05480
C                 RTN(3)='ICOM', THE FIRST COMMON NODE OF THE TWO NODE- NET05490
C                        TO-ROOT PATHS FROM EACH END-NODE OF KARC.      NET05500
C                 RTN(10)= THE NUMBER OF ARCS FORMING THIS CYCLE.       NET05510
C                 RTN(11)= SUM OF UNIT COSTS OF ALL ARCS IN THE CYCLE.  NET05520
C                 RTN(4,5,6,14)=  SEE (3) BELOW.                        NET05531
C                'U' = 'U'(IN COMMON) IS USED AS SCRATCH ARRAY TO STORE NET05540
C                         THE ARC-IDS IN THE CYCLE: U(1),...,U(RTN(10)).NET05550
C          =40: RUN TERMINATED - MAXIMUM NUMBER OF PIVOTS EXCEEDED;     NET05560
C                 (SEE II.2, 'RNCNT', FOR CONTINUING WITH MORE PIVOTS.) NET05570
C                                                                       NET05580
C          =50: A FAP(KARC) HAS BEEN ENCOUNTERED WHICH SATURATES ONE OR NET05581
C                MORE ARCS OF GIVEN INFINITE CAPACITY (ASSUMED AS MW).  NET05582
C                ALL GIVEN CAPACITIES AND EXOGENOUS FLOWS MUST BE       NET05583
C                SCALED DOWN AND THE RUN REPEATED. THE RELEVANT RESULTS NET05584
C               FOR THIS CASE ARE IDENTICAL TO THOSE FOR RTN(1)=30.     NET05585
C                                                                       NET05586
C 2. ERROR EXITS:                                                       NET05590
C    RTN(1)=100: TOTAL SUPPLY RTN(2) NOT EQUAL TO TOTAL DEMAND RTN(4).  NET05600
C          =110: THE MAGNITUDE OF THE TOTAL SUPPLY OR DEMAND IS GREATER NET05610
C                  THAN OR EQUAL TO THE MAXIMUM INTEGER : 2**(BT-1)-1.  NET05620
C          =120: NEGATIVE CAPACITY RTN(6) GIVEN FOR ARC ID: RTN(2),     NET05630
C                  I.E. FROM NODE RTN(4) TO NODE RTN(5).                NET05640
C          =130: BAD ARC DEFINITION FOR ARC RTN(2), I.E. FROM NODE      NET05650
C                  RTN(4) TO NODE RTN(5).                               NET05660
C          =140: PBAR IS NOT STRICTLY LARGER THAN 1.0.                  NET05670
C          =150: BAD PROBLEM TYPE OR BAD PROBLEM DATA FOR PROBLEM TYPE. NET05680
C          =160: RANGE OF THE GIVEN ARC COSTS (IN RTN(2),RTN(3)) IS TOO NET05690
C                  LARGE FOR THE SPECIFIED INTEGER WORDLENGTH 'BT',     NET05700
C                  AND/OR VALUES FOR P0, PBAR ARE TOO LARGE.            NET05710
C          =170: THERE ARE RTN(2) NODES WITH NO INCIDENT ARCS.  THE     NET05720
C                  DEGREE OF NODE 'I' IS RETURNED IN U(I), I=1,...,M.   NET05730
C                                                                       NET05740
C          =200: TOTAL CHANGES TO EXOGENOUS FLOWS (RETURNED IN RTN(2)), NET05750
C                  DO NOT SUM TO ZERO.                                  NET05760
C          =210: BAD REVISED CAPACITY RTN(6), FOR ARC RTN(2), I.E. FROM NET05770
C                  NODE RTN(4) TO NODE RTN(5). THE GIVEN CHANGE IN      NET05780
C                  CAPACITY IS RETURNED IN RTN(7).                      NET05790
C          =220: BAD NODE ID RTN(2) FOR EXOGENOUS-FLOW CHANGE RTN(7).   NET05800
C          =230: BAD ARC ID RTN(2) FOR COST/CAPACITY-CHANGE RTN(7).     NET05810
C          =240: BAD CALL TO RNRVCV,RNRVBV, OR RNRVHV.                  NET05820
C                                                                       NET05830
C          =300: BAD CALL TO SERVICE ROUTINES 1-12 (SEE III. ABOVE)     NET05840
C                  FIRST CALL PARAMETER INCORRECT (RETURNED IN RTN(2)). NET05850
C          =310: BAD CALL TO SERVICE ROUTINE 'RNWSOL'.                  NET05860
C          =320: INCORRECT NUMBER OF CANDIDATE ARCS FOR PRICING (NCAND  NET05870
C                RETURNED IN RTN(2)).                                   NET05880
C          =330: BAD ARC INDEX (RETURNED IN RTN(4)) IN THE RTN(3)-RD    NET05890
C                ELEMENT OF THE 'PCAND' LIST, WHICH IS DEFINED FOR      NET05900
C                RTN(2) ELEMENTS.                                       NET05910
C                                                                       NET05920
C          =800: PROGRAM ERROR (FROM SUBROUTINE RNREV; E.PT. RNREST).   NET05930
C                                                                       NET05940
C 3. RUN STATISTICS  ( IF RTN(1)= 0, 10, 20, OR 40 ):                   NET05950
C                                                                       NET05960
C    RTN(2) : VALUE OF GIVEN OBJECTIVE FUNCTION,  Z MODULO MW.          NET05970
C    RTN(3) : INTEGER PART OF : (Z/MW), I.E. THE VALUE OF THE OBJECTIVE NET05980
C               FUNCTION  Z = RTN(2) + RTN(3)*MW.                       NET05990
C    RTN(4) : MAJOR ITERATIONS OR PIVOTS            (TOTAL).            NET06000
C    RTN(5) : MAJOR DEGENERATE ITERATIONS OR PIVOTS (TOTAL).            NET06010
C    RTN(6) : MINOR ITERATIONS                      (TOTAL).            NET06020
C    RTN(7) : MAJOR ITERATIONS OR PIVOTS    (1ST PASS OF PENLTY METHOD) NET06030
C    RTN(8) : MAJOR DEGENERATE ITERATNS OR PIVOTS (   ''    ''    ''  ) NET06040
C    RTN(9) : MINOR ITERATIONS                    (   ''    ''    ''  ) NET06050
C    RTN(10): TOTAL NUMBER OF SATURATED ARCS IN THE FINAL SOLUTION.     NET06060
C    RTN(11): NUMBER OF BASIC ARTIFICIALS WITH POSITIVE FLOW.           NET06070
C    RTN(12): TOTAL NUMBER OF ARCS 'PRICED' DURING THIS RUN, I.E. SINCE NET06080
C               THE LAST CALL TO RNET OR RNREST.                        NET06090
C    RTN(13): MINIMUM ARC COST (GIVEN INITIALLY OR AFTER REVISION).     NET06100
C    RTN(14): MAXIMUM ARC COST (GIVEN INITIALLY OR AFTER REVISION).     NET06110
C    RTN(15): MINIMUM ARC CAPACITY (INITIALLY OR AFTER REVISION).       NET06120
C    RTN(16): MAXIMUM ARC CAPACITY (INITIALLY OR AFTER REVISION).       NET06130
C    RTN(17): MINIMUM DEGREE OF NODES (BASED ON INITIAL DATA).          NET06140
C    RTN(18): MAXIMUM DEGREE OF NODES (BASED ON INITIAL DATA).          NET06150
C ********************************************************************  NET06160
C                                                                       NET06170
C              V. SOLVING SPECIAL CASES OF 'MCNF' PROBLEMS:             NET06180
C                                                                       NET06190
C                  SUBROUTINE CALL:  CALL RNET                          NET06200
C                                                                       NET06210
C  1. SOLVING MAXIMUM-FLOW PROBLEMS:                                    NET06220
C                                                                       NET06230
C  MAXIMUM FLOW PROBLEMS, FROM ONE SOURCE TO ONE SINK NODE, CAN BE      NET06240
C  SOLVED VIA RNET (WITH INPUT ARGUMENTS AS IN PART I) PROVIDED THAT:   NET06250
C                                                                       NET06260
C    1. PROBLEM TYPE IS SET TO PT=1.                                    NET06270
C    2. COSTS OF ALL ARCS ARE SET TO ZERO, I.E. INITIALIZE  C=0.        NET06280
C    3. ALL EXOGENOUS FLOWS ARE SET TO ZERO, I.E. INITIALIZE X=0.       NET06290
C    4. ONE ARC, FROM SINK TO SOURCE, IS ADDED TO THE ARC LIST (I.E. N  NET06300
C        IS INCREASED TO N+1), WITH COST C(N)=-1 AND CAPACITY H(N)=MW.  NET06310
C    5. IT IS ADVISABLE, BUT NOT NECESSARY, TO SET IRT=SOURCE NODE,     NET06320
C        I.E. IRT=TO(N).                                                NET06330
C                                                                       NET06340
C  UPON SUCCESSFUL COMPLETION OF RNET (I.E. RTN(1)=0), THE MAXIMUM FLOW NET06350
C  FOR THE PROBLEM IS -RTN(2) OR THE FLOW IN THE ADDED (CIRCULATION)    NET06360
C  ARC.  THE REST OF THE SOLUTION IS GIVEN AS IN PART I ABOVE.          NET06370
C                                                                       NET06380
C  2. SOLVING SHORTEST-PATH PROBLEMS:                                   NET06390
C                                                                       NET06400
C  SHORTEST PATH PROBLEMS, FROM ONE 'ORIGIN' (SAY, NODE 'K') TO EVERY   NET06410
C  OTHER NODE, CAN BE SOLVED BY RNET, PROVIDED THAT:                    NET06420
C                                                                       NET06430
C    1. PROBLEM TYPE IS SET TO PT=0, AND THE ROOT IS SET TO IRT=K.      NET06440
C    2. CAPACITIES OF ALL ARCS ARE SET TO ZERO, I.E. INITIALIZE  H=0.   NET06450
C    3. EXOGENOUS FLOWS ARE INITIALIZED TO X(I)=-1 FOR ALL I, EXCEPT    NET06460
C        THAT FOR NODE K,  X(K)=M-1.                                    NET06470
C                                                                       NET06480
C  UPON SUCCESSFUL COMPLETION OF RNET (I.E. RTN(1)=0), THE BASIS TREE   NET06490
C  REPRESENTS THE TREE OF SHORTEST PATHS AND THE NEGATIVE OF THE U(I)   NET06500
C  GIVES THE SHORTEST PATH FROM NODE 'K' TO NODE 'I'.                   NET06510
C                                                                       NET06520
C ********************************************************************  NET06530
C                                                                       NET06540
C               VI. THE USER'S CALLING PROGRAM:                         NET06550
C                                                                       NET06560
C 1. THE USER'S CALLING PROGRAM MUST CONTAIN THE STANDARD DECLARATION   NET06570
C    BLOCK, EXACTLY AS IT APPEARS IN THE FOLLOWING 14 LINES:            NET06580
C                                                                       NET06590
CC***** START OF RNET-STANDARD COMMON BLOCK *************************** NET06600
CC** COMMON: M-LONG ARRAYS: P,F,D,U,ARC,X,R; N-LONG: FROM,TO,C,H; PCAND NET06610
CC** SIZE OF THESE ARRAYS MUST BE DECLARED IN THE USER'S CALLING PRGM.  NET06620
C      INTEGER*2 FROM,TO,F,D,P,R                                        NET06630
C      INTEGER*2 C                                                      NET06640
C      INTEGER   BT,PT,PAS,RTN,LPR,H,U,ARC,X,PCAND                      NET06650
C      DIMENSION P(MM),F(MM),D(MM),U(MM),ARC(MM),X(MM),R(MM)            NET06660
C      DIMENSION FROM(NN),TO(NN),C(NN),H(NN)                            NET06670
C      DIMENSION PCAND(KK)                                              NET06680
C      DIMENSION RTN(20),LPR(12),RTT(2)                                 NET06690
C      COMMON /A/FROM/B/TO/C/C/D/H/E/P/F/F/G/D/H/U/I/ARC/J/X/K/R/N/PCANDNET06700
C      COMMON /L/BT,MW,PT,M,N,IRT,MXIT,FRQ,P0,PBAR,CP,PAS,RTN,LPR,RTT,  NET06710
C     *          NCAND                                                  NET06720
CC***** END OF RNET-STANDARD COMMON BLOCK ***************************** NET06730
C                                                                       NET06740
C  WHERE MM.GE.M, NN.GE.N, INDICATE MAXIMUM ARRAY SIZES WHICH THE USER  NET06750
C  MUST EXPLICITLY SUBSTITUTE BY INTEGER CONSTANTS IN THE ABOVE 14      NET06760
C  LINES.  SIMILARLY, IF A PRICING CANDIDATE LIST IS TO BE DEFINED AND  NET06770
C  USED, KK MUST BE SET ABOVE TO THE MAXIMUM LENGTH OF THE PCAND LIST.  NET06780
C  OTHERWISE, KK CAN BE SET TO 1 ABOVE ( AND ALSO SET NCAND=0 ).        NET06790
C                                                                       NET06800
C  IN RNET, THESE ARRAYS HAVE BEEN DIMENSIONED TO 1, SO THAT RNET NEEDS NET06810
C  TO BE COMPILED ONLY ONCE.  WHENEVER A LARGER PROBLEM CAPACITY IS     NET06820
C  REQUIRED, THE USER MUST REVISE 'MM' AND 'NN' ABOVE, BUT NEEDS TO     NET06830
C  RECOMPILE ONLY HIS CALLING PROGRAM OR SUBROUTINE.                    NET06840
C                                                                       NET06850
C  THE USER MAY WISH TO DECLARE ADDITIONAL ARRAYS IN ORDER TO:          NET06860
C   1) SAVE THE ORIGINAL EXOGENOUS FLOWS ( VECTOR 'B') FOR LATER USE.   NET06870
C   2) USE SOME OF THE RNET REVISE OR SERVICE ROUTINES, SUCH AS RNRVCV, NET06880
C      RNRVHV, RNRVHJ, RNFTNI,RNFTNR, RNBTNI,RNBTNR(SEE II, III ABOVE). NET06890
C                                                                       NET06900
C  THE USER MUST TAKE THE OBVIOUS PRECAUTIONS IN HIS CALLING PROGRAM    NET06910
C  TO PROTECT ALL THE VARIABLES, LISTED IN THE RNET-STANDARD COMMON     NET06920
C  BLOCK ABOVE, FROM BEING ASSIGNED VALUES INCOMPATIBLE WITH RNET.      NET06930
C                                                                       NET06940
C  INTEGER*2 REFERS TO TWO-BYTE INTEGER VARIABLES WHICH ARE ALLOWED BY  NET06950
C  IBM FORTRAN COMPILERS.  THEY SHOULD BE ALTERED TO 'INTEGER' FOR CPUS NET06960
C  AND COMPILERS WHICH DO NOT SUPPORT THIS STORAGE-SAVING FACILITY, AND NET06970
C  DECLARATION SECTIONS OF RNET AND OF ITS SUBROUTINES MUST BE CHANGED. NET06980
C                                                                       NET06990
C  FOR AN IBM MACHINE, THE ABOVE DECLARATION BLOCK ALLOWS MM=32767,     NET07000
C  NN=2147483647, AND ALL PROBLEM DATA THE LATTER MAGNITUDE, EXCEPT FOR NET07010
C  THE COST VECTOR 'C' WHOSE ELEMENTS CANNOT EXCEED, IN MAGNITUDE,      NET07020
C  32767.  SHOULD A LARGER MAGNITUDE FOR COSTS BE NECESSARY, THE USER   NET07030
C  MUST DECLARE 'C' AS AN 'INTEGER' (I.E. NOT INTEGER*2) ABOVE, AS WELL NET07040
C  AS IN THE DECLARATION SECTIONS OF 'RNET' AND ALL OF ITS SUBROUTINES. NET07050
C                                                                       NET07060
C  FOR BEST RUN-EFFICIENCY, RNET SHOULD BE COMPILED UNDER FORTRAN H     NET07070
C  WITH OPT=2, THOUGH IT WILL WORK WITH MOST OTHER FORTRAN COMPILERS.   NET07080
C                                                                       NET07090
C 2. THE USER MUST ALSO PROVIDE A 'TIMING' SUBROUTINE AS SHOWN BELOW:   NET07100
C                                                                       NET07110
C                    SUBROUTINE RNTIME(TSECS)                           NET07120
C                    TSECS = CURRENT (NOT ELAPSED) CPU TIME, SECONDS,   NET07130
C                            (AS PROVIDED BY THE USER'S INSTALLATION).  NET07140
C                    RETURN                                             NET07150
C                    END                                                NET07160
C                                                                       NET07170
C  NOTE: THE USER SHOULD NOT ALTER THE TIMING CALLS WITHIN 'RNET'.      NET07180
C        ALL TIMING SUBROUTINE ADJUSTMENTS MUST BE ACCOMPLISHED IN      NET07190
C        THE ABOVE ROUTINE AND/OR IN THE USER'S CALLING PROGRAM.        NET07200
C        IF THE USER'S INSTALLATION DOES NOT OFFER A CPU-TIME SUB-      NET07210
C        ROUTINE, THE USER MAY SET  'TSECS' ABOVE TO 0.0.               NET07220
C                                                                       NET07230
C        THE USERS WHO MAY WISH TO REPORT RNET EXECUTION TIME SHOULD    NET07240
C        INSURE THAT 'TSECS' PROVIDES THE CURRENT CPU TIME, USUALLY     NET07250
C        REFERRED TO AS THE 'PROBLEM-STATE TIME', AS OPPOSED TO         NET07260
C        ELAPSED OR TO OTHER MEASURES OF TIME WHICH NORMALLY INCLUDE    NET07270
C        SYSTEM OVERHEAD UNRELATED TO THE EXECUTION OF RNET. THIS IS    NET07280
C        ESPECIALLY IMPORTANT WHEN EXECUTING ON MULTIPROCESSING OR      NET07290
C        MULTIPROGRAMMING COMPUTER SYSTEMS.                             NET07300
C                                                                       NET07310
C ********************************************************************* NET07320
C                                                                       NET07330
C              VII. THE STRUCTURE OF RNET:                              NET07340
C                                                                       NET07350
C                                                                       NET07360
C    RNET-    NUMBER  SIZE                                              NET07370
C    SUBR     SOURCE   IN       INTERNAL RNET CALLS       USER   OPT'L  NET07380
C    NAME:    STMNTS  BYTES         ISSUED TO:          CALLABLE? SUBR  NET07390
C               (1)    (2)                                 (3)    (4)   NET07400
C    -----    ------ ------- ---------------------------  -----  -----  NET07410
C    RNET        16     260  RNET1                        YES           NET07420
C    RNET1      209    2534  RNTIME RNINIT RNATL  RNUPDF   NO           NET07430
C                            RNCYCL RNDUL1 RNPIVT RNCHK                 NET07440
C                            RNOBJI                                     NET07450
C    RNCNT       36     550  RNTIME RNET1                 YES           NET07460
C    RNCNT0      16     260                                NO           NET07470
C    RNCHK       79    1332  RNPENY RNDUL1                 NO           NET07480
C    RNCYCL      36     614                                NO           NET07490
C    RNINIT     215    2778                                NO           NET07500
C    RNDUL1      27     396                                NO           NET07510
C    RNPENY      61    1054                                NO           NET07520
C    RNATL      175    1680                                NO           NET07530
C    RNUPDF      58     734                                NO           NET07540
C    RNPIVT      96    1366                                NO           NET07550
C    RNREV       36     544                               YES      *    NET07560
C    RNRVCJ      26     404                               YES      *    NET07570
C    RNRVCV      25     422                               YES      *    NET07580
C    RNRVBI      25     372                               YES      *    NET07590
C    RNRVBV      30     508                               YES      *    NET07600
C    RNRVHJ      40     536                               YES      *    NET07610
C    RNRVHV      45     622                               YES      *    NET07620
C    RNREST     114    1468  RNTIME RNPENY RNDUL1 RNCNT0  YES      *    NET07630
C    RNOBJI     149    2308                               YES           NET07640
C    RNOBJR      48     678                               YES      *    NET07650
C    RNBPRL      40     540                               YES      *    NET07660
C    RNAPRL      44     694                               YES      *    NET07670
C    RNBTNI      32     522                               YES      *    NET07680
C    RNBTNR      32     524                               YES      *    NET07690
C    RNROW       33     514                               YES      *    NET07700
C    RNFTNI      36     590                               YES      *    NET07710
C    RNFTNR      35     592                               YES      *    NET07720
C    RNCOL       32     454                               YES      *    NET07730
C    RNFAP       58     818                               YES      *    NET07740
C    RNSTEP      47     572  RNATL  RNUPDF RNPIVT         YES      *    NET07750
C    RNWIPA      18     314  RNWPAR                       YES      *    NET07760
C    RNWFPA      16     298  RNWPAR                       YES      *    NET07770
C    RNWPAR      48    1994                                NO      *    NET07780
C    RNWSOL     148    2908  RNBPRL RNAPRL                YES      *    NET07790
C                                                                       NET07800
C  NOTES: 1. NUMBER OF SOURCE STATEMENTS, EXCLUDING COMMENTS.           NET07810
C         2. COMPILED PROGRAM SIZE, IN BYTES, UNDER IBM'S FORTRAN H     NET07820
C              COMPILER ( WITH OPT=2 ) FOR THE SYSTEM 370.              NET07830
C         3. IT IS RECOMMENDED THAT USER-ISSUED CALLS TO SUBROUTINES    NET07840
C              MARKED 'NO' ARE AVOIDED.                                 NET07850
C         4. ENTIRELY OPTIONAL SUBROUTINES(*) WHICH ARE NOT NEEDED BY   NET07860
C              THE USER OR BY OTHER RNET SUBROUTINES CAN BE ELIMINATED. NET07870
C                                                                       NET07880
C****** END OF RNET COMMENTS *******************************************NET07890
C                                                                       NET07900
C*** S U B R O U T I N E   R N E T ***                                  NET07910
C                                                                       NET07920
C***** START OF RNET-STANDARD COMMON BLOCK *****************************XXX07930
C** COMMON: M-LONG ARRAYS: P,F,D,U,ARC,X,R; N-LONG: FROM,TO,C,H; PCAND**XXX07940
C** SIZE OF THESE ARRAYS MUST BE DECLARED IN THE USER'S CALLING PRGM. **XXX07950
      INTEGER   FROM,TO,F,D,P,R                                         XXX07960
      INTEGER   C                                                       XXX07970
      INTEGER   BT,PT,PAS,RTN,LPR,H,U,ARC,X,PCAND                       XXX07980
      DIMENSION P(1),F(1),D(1),U(1),ARC(1),X(1),R(1)                    XXX07990
      DIMENSION FROM(1),TO(1),C(1),H(1)                                 XXX08000
      DIMENSION PCAND(1)                                                XXX08010
      DIMENSION RTN(20),LPR(12),RTT(2)                                  XXX08020
      COMMON /A/FROM/B/TO/C/C/D/H/E/P/F/F/G/D/H/U/I/ARC/J/X/K/R/N/PCAND XXX08030
      COMMON /L/BT,MW,PT,M,N,IRT,MXIT,FRQ,P0,PBAR,CP,PAS,RTN,LPR,RTT,   XXX08040
     *          NCAND                                                   XXX08050
      DIMENSION IREVFL(4)                                               XXX08060
      COMMON /M/IREVFL,KARC,ICOM,ITH,MAXF,LNOD,MIC,MAC,NPE,IT,IT0,LGAM, XXX08070
     *          ISDB,TE0                                                XXX08080
C***** END OF RNET-STANDARD COMMON BLOCK *******************************XXX08090
C MAIN ENTRY TO RNET SIMPLEX METHOD.                                    NET08100
      IFLAG=0                                                           NET08110
      CALL RNET1(IFLAG)                                                 NET08120
      RETURN                                                            NET08130
      END                                                               NET08140
      SUBROUTINE RNET1(IFLAG)                                           ET100010
C                                                                       ET100020
C***** START OF RNET-STANDARD COMMON BLOCK *****************************XXX00030
C** COMMON: M-LONG ARRAYS: P,F,D,U,ARC,X,R; N-LONG: FROM,TO,C,H; PCAND**XXX00040
C** SIZE OF THESE ARRAYS MUST BE DECLARED IN THE USER'S CALLING PRGM. **XXX00050
      INTEGER   FROM,TO,F,D,P,R                                         XXX00060
      INTEGER   C                                                       XXX00070
      INTEGER   BT,PT,PAS,RTN,LPR,H,U,ARC,X,PCAND                       XXX00080
      DIMENSION P(1),F(1),D(1),U(1),ARC(1),X(1),R(1)                    XXX00090
      DIMENSION FROM(1),TO(1),C(1),H(1)                                 XXX00100
      DIMENSION PCAND(1)                                                XXX00110
      DIMENSION RTN(20),LPR(12),RTT(2)                                  XXX00120
      COMMON /A/FROM/B/TO/C/C/D/H/E/P/F/F/G/D/H/U/I/ARC/J/X/K/R/N/PCAND XXX00130
      COMMON /L/BT,MW,PT,M,N,IRT,MXIT,FRQ,P0,PBAR,CP,PAS,RTN,LPR,RTT,   XXX00140
     *          NCAND                                                   XXX00150
      DIMENSION IREVFL(4)                                               XXX00160
      COMMON /M/IREVFL,KARC,ICOM,ITH,MAXF,LNOD,MIC,MAC,NPE,IT,IT0,LGAM, XXX00170
     *          ISDB,TE0                                                XXX00180
C***** END OF RNET-STANDARD COMMON BLOCK *******************************XXX00190
C CONTROLS THE RNET SIMPLEX METHOD FLOW.                                ET100200
C                                                                       ET100210
C RNET-INTERNAL VARIABLES(IN COMMON M)                                  ET100220
C                                                                       ET100230
C'KARC' : ARC INDEX OF ENTERING ARC.                                    ET100240
C'ICOM' : THE 1ST COMMON NODE OF THE                                    ET100250
C         TWO PATHS FROM EACH END NODE                                  ET100260
C         OF 'KARC' TO THE ROOT 'IRT'.                                  ET100270
C'LNOD' : TREE POS'N OF LEAVING ARC.                                    ET100280
C'ITH'  : =1, ARC LEAVES AT L.BND.                                      ET100290
C         =2,  ''    ''  AT CAPACITY.                                   ET100300
C         =3, NO ARC LEAVES TREE; ARC                                   ET100310
C             'KARC' REMAINS NONBASIC                                   ET100320
C             AT ITS OPPOSITE BOUND.                                    ET100330
C'MAXF' : FLOW AUGMENTATION FOR FAP                                     ET100340
C         ARCS (EXCEPT AFTER 'RNUPDF',                                  ET100350
C         MAXF=FLOW IN ENTERING ARC).                                   ET100360
C'MIC'  : MIN OF ALL ARC COSTS.                                         ET100370
C'MAC'  : MAX OF ALL ARC COSTS.                                         ET100380
C'PEN'  : CURRENT PENALTY FOR ARTIFLS.                                  ET100390
C'IT'   : PRICING ARC FREQUENCY.                                        ET100400
C'IT0'  : START-ARC INDEX IN PRICING.                                   ET100410
C'LGAM' : =1;'LNOD'IS ON NODE-TO-ROOT                                   ET100420
C            PATH FROM 'FROM(KARC)'.                                    ET100430
C         =0; OTHERWISE.                                                ET100440
C'ISDB' : SUM OF CHANGES IN EXOG.FLOWS                                  ET100450
C*************************************                                  ET100460
C                                                                       ET100470
      IF(IFLAG.NE.0)GOTO5                                               ET100480
CHECK DATA & SET ALL-ARTFICIAL BASIS                                    ET100490
      CALL RNTIME(TE0)                                                  ET100500
      CALL RNINIT(NUMRTN)                                               ET100510
      IF(NUMRTN.EQ.1)GOTO200                                            ET100520
      GOTO6                                                             ET100530
C                                                                       ET100540
5     IF(IFLAG.NE.1)GOTO10                                              ET100550
C RESTART WITH REVISED DATA HERE:                                       ET100560
6     MW=(2**(BT-2)-1)*2+1                                              ET100570
      ITMJ=0                                                            ET100580
      ITMJD=0                                                           ET100590
      ITMI=0                                                            ET100600
      IT0=0                                                             ET100610
      NSWP=0                                                            ET100620
      GOTO12                                                            ET100630
C                                                                       ET100640
C ENTER HERE FROM SUBR. 'RNCNT(.)'                                      ET100650
C FOR MORE PIVOTS UP TO 'MXIT'.                                         ET100660
C                                                                       ET100670
10    IF(IFLAG.NE.2)GOTO180                                             ET100680
12    CALL RNTIME(TE1)                                                  ET100690
      RTT(1)=TE1-TE0                                                    ET100700
CHECK PROBLEM TYPE (0=MCNF, =1 MAX FL)                                  ET100710
      IF(PT.LT.0.OR.PT.GT.1)GOTO900                                     ET100720
      IMAC=IABS(MAC)                                                    ET100730
      IMIC=IABS(MIC)                                                    ET100740
      MAGNC=MAX0(IMAC,IMIC)                                             ET100750
C*************************************                                  ET100760
C SIMPLEX ITERATION STARTS HERE:                                        ET100770
CHECK MAJOR ITERATION CUTOFF LIMIT:                                     ET100780
20    IF(MXIT.LE.ITMJ)GOTO180                                           ET100790
C PRICING: SELECT ENTERING ARC 'KARC':                                  ET100800
      ITP=0                                                             ET100810
C SELECT BEST STRATEGY FOR PROBLEM TYPE:                                ET100820
      IF(PT.EQ.1)GOTO32                                                 ET100830
C (PRICING CODE IN-LINE FOR EFFICIENCY)                                 ET100840
C****************************************                               ET100850
C PRICING ROUTINE FOR MCNF (PT=0) PROBS.                                ET100860
C                                                                       ET100870
      IF(NCAND.NE.0)GOTO130                                             ET100880
C PRICING OVER ENTIRE ARC SET.                                          ET100890
C ITP=NO.OF CONSECTVE OPTIML SUBSETS S:                                 ET100900
30    IF(IT0.LT.IT)GOTO40                                               ET100910
        IT0=0                                                           ET100920
        NSWP=NSWP+1                                                     ET100930
40      IT0=IT0+1                                                       ET100940
C MIN OVER SUBSET S=(EVERY IT-TH ARC,                                   ET100950
C   STARTING WITH THE IT0-TH ARC):                                      ET100960
C STRATEGY FOR 'MNCF' PROBLEMS:                                         ET100970
        MINZ=1                                                          ET100980
        DO 50 I=IT0,N,IT                                                ET100990
         IZ=C(I)-U(FROM(I))+U(TO(I))                                    ET101000
         IF(H(I).LT.0)IZ=-IZ                                            ET101010
         IF(IZ.GE.0)GOTO50                                              ET101020
         IF(IZ.GE.MINZ)GOTO50                                           ET101030
         MINZ=IZ                                                        ET101040
         KARC=I                                                         ET101050
50      CONTINUE                                                        ET101060
        IF(MINZ.LT.1)GOTO60                                             ET101070
C END SEARCH IF 'IT' CONSCTVE 'S' OPTML                                 ET101080
        IF(ITP.GE.IT)GOTO100                                            ET101090
        ITP=ITP+1                                                       ET101100
      GOTO30                                                            ET101110
C                                                                       ET101120
C PRICING OVER ARCS IN 'PCAND' LIST,                                    ET101130
C WITH SAME STRATEGY AS ABOVE:                                          ET101140
130   IF(IT0.LT.IT)GOTO140                                              ET101150
        IT0=0                                                           ET101160
        NSWP=NSWP+1                                                     ET101170
140     IT0=IT0+1                                                       ET101180
        MINZ=1                                                          ET101190
        DO 150 II=IT0,NCAND,IT                                          ET101200
         I=PCAND(II)                                                    ET101210
         IZ=C(I)-U(FROM(I))+U(TO(I))                                    ET101220
         IF(H(I).LT.0)IZ=-IZ                                            ET101230
         IF(IZ.GE.0)GOTO150                                             ET101240
         IF(IZ.GE.MINZ)GOTO150                                          ET101250
         MINZ=IZ                                                        ET101260
         KARC=I                                                         ET101270
150     CONTINUE                                                        ET101280
        IF(MINZ.LT.1)GOTO60                                             ET101290
        IF(ITP.GE.IT)GOTO100                                            ET101300
        ITP=ITP+1                                                       ET101310
      GOTO130                                                           ET101320
C***********************                                                ET101330
C                                                                       ET101340
C PRICING ROUTINE FOR MAXFLO (PT=1) PROBS                               ET101350
C                                                                       ET101360
32    IF(NCAND.NE.0)GOTO135                                             ET101370
C PRICING OVER ENTIRE ARC SET.                                          ET101380
C SAME STRATEGY AS MCNF PROBLEMS ( BUT                                  ET101390
C WITH A STEEPEST DESCENT CRITERION;                                    ET101400
C MFAPLG=MIN FAP LENGTH):                                               ET101410
35    IF(IT0.LT.IT)GOTO45                                               ET101420
        IT0=0                                                           ET101430
        NSWP=NSWP+1                                                     ET101440
45      IT0=IT0+1                                                       ET101450
        MFAPLG=MW                                                       ET101460
        DO 55 I=IT0,N,IT                                                ET101470
         IZ=U(TO(I))-U(FROM(I))                                         ET101480
         IF(IZ.EQ.0)GOTO55                                              ET101490
         IF(H(I).LT.0)IZ=-IZ                                            ET101500
         IF(IZ.GE.0)GOTO55                                              ET101510
         IZ=D(FROM(I))+D(TO(I))                                         ET101520
         IF(IZ.GE.MFAPLG)GOTO55                                         ET101530
         MFAPLG=IZ                                                      ET101540
         KARC=I                                                         ET101550
55      CONTINUE                                                        ET101560
        IF(MFAPLG.LT.MW)GOTO60                                          ET101570
C END SEARCH IF 'IT' CONSCTVE 'S' OPTML                                 ET101580
        IF(ITP.GE.IT)GOTO100                                            ET101590
        ITP=ITP+1                                                       ET101600
      GOTO35                                                            ET101610
C                                                                       ET101620
C PRICING OVER SUBSET OR ARCS IN PCAND.                                 ET101630
C SAME STRATEGY AS ABOVE.                                               ET101640
135   IF(IT0.LT.IT)GOTO145                                              ET101650
        IT0=0                                                           ET101660
        NSWP=NSWP+1                                                     ET101670
145      IT0=IT0+1                                                      ET101680
        MFAPLG=MW                                                       ET101690
        DO 155 II=IT0,NCAND,IT                                          ET101700
         I=PCAND(II)                                                    ET101710
         IZ=U(TO(I))-U(FROM(I))                                         ET101720
         IF(IZ.EQ.0)GOTO155                                             ET101731
         IF(H(I).LT.0)IZ=-IZ                                            ET101740
         IF(IZ.GE.0)GOTO155                                             ET101750
         IZ=D(FROM(I))+D(TO(I))                                         ET101760
         IF(IZ.GE.MFAPLG)GOTO155                                        ET101770
         MFAPLG=IZ                                                      ET101780
         KARC=I                                                         ET101790
155     CONTINUE                                                        ET101800
        IF(MFAPLG.LT.MW)GOTO60                                          ET101810
C END SEARCH IF 'IT' CONSCTVE 'S' OPTML                                 ET101820
        IF(ITP.GE.IT)GOTO100                                            ET101830
        ITP=ITP+1                                                       ET101840
      GOTO135                                                           ET101850
C**** END OF THE PRICING CODE ***********                               ET101860
C                                                                       ET101870
C NOW SELECT ARC 'ARC(LNOD)' TO LEAVE:                                  ET101880
60    CALL RNATL(NUMRTN)                                                ET101890
      IF(NUMRTN.EQ.1)GOTO65                                             ET101900
C UPDATE FLOWS FOR ARCS IN FAP(KARC):                                   ET101910
      CALL RNUPDF(NUMRTN)                                               ET101920
      IF(NUMRTN.EQ.1)GOTO64                                             ET101930
      IF(ITH.NE.3)GOTO70                                                ET101940
C MINOR ITERATION (NO BASIS CHANGE):                                    ET101950
63    ITMI=ITMI+1                                                       ET101960
      GOTO20                                                            ET101970
C INFINITE SOLN.(PROVIDED, -VE CYCLE                                    ET101980
C HAS NO ARTIFCL ARCS, OR IF IT DOES,                                   ET101990
C ARTFCL ARCS HAVE SUFFCNTLY HIGH COST                                  ET102000
64    CALL RNCYCL(LENFAP,ICYCST,NUMRTN)                                 ET102010
      IF(NUMRTN.EQ.1)GOTO66                                             ET102020
C ANY ARC IN FAP(KARC) HAS INFIN. FLOW?                                 ET102021
      IF(NUMRTN.EQ.2)GOTO930                                            ET102022
C NO ARTFCL IN CYCLE: DECLARE INF SOL:                                  ET102030
      GOTO920                                                           ET102040
C ARTFCL IN CYCLE: TRY LARGER PENALTY:                                  ET102050
66    CALL RNPENY(CPN,NPEN,NPAS,NUMRTN)                                 ET102060
      GOTO(67,920,1000),NUMRTN                                          ET102070
67    CP=CPN                                                            ET102080
      NPE=NPEN                                                          ET102090
      PAS=NPAS                                                          ET102100
      CALL RNDUL1                                                       ET102110
      GOTO20                                                            ET102120
C MAJOR ITER(PIVOT,UPDATE DUALS&DEPTH)                                  ET102130
65    IF(ITH.EQ.3)GOTO63                                                ET102140
      ITMJD=ITMJD+1                                                     ET102150
70    CALL RNPIVT                                                       ET102160
      ITMJ=ITMJ+1                                                       ET102170
      GOTO20                                                            ET102180
C END OF PRIMAL SIMPLEX ITERATION.                                      ET102190
C**************************************                                 ET102200
C OPTIMALITY/FEASIBILITY CHECKS ( PER                                   ET102210
C 'GRADUAL PENALTY' METHOD ):                                           ET102220
C FIRST, COMPUTE TRIAL PENALTY:                                         ET102230
100   CALL RNCHK(ITMJ,ITMJD,ITMI,NUMRTN)                                ET102240
      GOTO(180,20,190,1000),NUMRTN                                      ET102250
C                                                                       ET102260
C EXIT CHORES                                                           ET102270
C MAJOR ITERATION(PIVOT)-LIMIT EXCEEDED                                 ET102280
180   RTN(1)=40                                                         ET102290
      RTN(11)=0                                                         ET102300
190   CALL RNTIME(TE2)                                                  ET102310
      RTT(2)=TE2-TE1                                                    ET102320
C FINAL VALUE OF OBJECTIVE FUNCTION:                                    ET102330
C  ( Z = RTN(2) + RTN(3) * MW )                                         ET102340
      CALL RNOBJI                                                       ET102350
C SAVE TOTAL NO. OF ITERATIONS:                                         ET102360
200   RTN(4)=ITMJ                                                       ET102370
      RTN(5)=ITMJD                                                      ET102380
      RTN(6)=ITMI                                                       ET102390
COMPUTE NUMBER OF ARCS PRICED                                           ET102400
      IRES=MOD(N,IT)                                                    ET102410
      LOW=N/IT                                                          ET102420
      IF(IRES.EQ.0)GOTO210                                              ET102430
      LHI=LOW+1                                                         ET102440
      GOTO220                                                           ET102450
210   IRES=IT                                                           ET102460
      LHI=LOW                                                           ET102470
220   JCT=NSWP*N                                                        ET102480
      IF(IT0.GT.IRES)GOTO230                                            ET102490
      JCT=JCT+IT0*LHI                                                   ET102500
      GOTO240                                                           ET102510
230   JCT=JCT+IRES*LHI+(IT0-IRES)*LOW                                   ET102520
240   RTN(12)=JCT                                                       ET102530
      GOTO1000                                                          ET102540
C BAD PROBLEM TYPE OR BAD PROBLM DATA:                                  ET102550
900   RTN(1)=150                                                        ET102560
      GOTO1000                                                          ET102570
C NEGATIVE CYCLE W/ INF CAP. FOUND:                                     ET102580
920   RTN(1)=30                                                         ET102590
925   RTN(2)=KARC                                                       ET102601
      RTN(3)=ICOM                                                       ET102610
      RTN(10)=LENFAP                                                    ET102620
      RTN(11)=ICYCST                                                    ET102630
      GOTO200                                                           ET102640
930   RTN(1)=50                                                         ET102641
      GOTO925                                                           ET102642
1000  RETURN                                                            ET102650
      END                                                               ET102660
      SUBROUTINE RNCNT(ITADDL)                                          CNT00010
C                                                                       CNT00020
C***** START OF RNET-STANDARD COMMON BLOCK *****************************XXX00030
C** COMMON: M-LONG ARRAYS: P,F,D,U,ARC,X,R; N-LONG: FROM,TO,C,H; PCAND**XXX00040
C** SIZE OF THESE ARRAYS MUST BE DECLARED IN THE USER'S CALLING PRGM. **XXX00050
      INTEGER   FROM,TO,F,D,P,R                                         XXX00060
      INTEGER   C                                                       XXX00070
      INTEGER   BT,PT,PAS,RTN,LPR,H,U,ARC,X,PCAND                       XXX00080
      DIMENSION P(1),F(1),D(1),U(1),ARC(1),X(1),R(1)                    XXX00090
      DIMENSION FROM(1),TO(1),C(1),H(1)                                 XXX00100
      DIMENSION PCAND(1)                                                XXX00110
      DIMENSION RTN(20),LPR(12),RTT(2)                                  XXX00120
      COMMON /A/FROM/B/TO/C/C/D/H/E/P/F/F/G/D/H/U/I/ARC/J/X/K/R/N/PCAND XXX00130
      COMMON /L/BT,MW,PT,M,N,IRT,MXIT,FRQ,P0,PBAR,CP,PAS,RTN,LPR,RTT,   XXX00140
     *          NCAND                                                   XXX00150
      DIMENSION IREVFL(4)                                               XXX00160
      COMMON /M/IREVFL,KARC,ICOM,ITH,MAXF,LNOD,MIC,MAC,NPE,IT,IT0,LGAM, XXX00170
     *          ISDB,TE0                                                XXX00180
C***** END OF RNET-STANDARD COMMON BLOCK *******************************XXX00190
CONTINUE RNET FROM WHERE LEFT OFF                                       CNT00200
C FOR A MAX OF ITADDL PIVOTS:                                           CNT00210
      IF(ITADDL.LE.0)GOTO180                                            CNT00220
      IF(ITMJ.LE.0)GOTO180                                              CNT00230
      MXIT=MXIT+ITADDL                                                  CNT00240
      RTN(1)=0                                                          CNT00250
      IF(PAS.LT.0)PAS=0                                                 CNT00260
      IF(NCAND.EQ.0)GOTO110                                             CNT00270
      IF(NCAND.LT.0.OR.NCAND.GT.N)GOTO945                               CNT00280
      IT=FRQ*NCAND*0.01+0.5                                             CNT00290
      IT=MAX0(1,IT)                                                     CNT00300
110   CALL RNTIME(TE0)                                                  CNT00310
      IFLAG=2                                                           CNT00320
      GOTO320                                                           CNT00330
180   IFLAG=3                                                           CNT00340
320   CALL RNET1(IFLAG)                                                 CNT00350
1000  RETURN                                                            CNT00360
945   RTN(1)=320                                                        CNT00370
      RTN(2)=NCAND                                                      CNT00380
      GOTO1000                                                          CNT00390
      END                                                               CNT00400
      SUBROUTINE RNCNT0                                                 NT000010
C                                                                       NT000020
C***** START OF RNET-STANDARD COMMON BLOCK *****************************XXX00030
C** COMMON: M-LONG ARRAYS: P,F,D,U,ARC,X,R; N-LONG: FROM,TO,C,H; PCAND**XXX00040
C** SIZE OF THESE ARRAYS MUST BE DECLARED IN THE USER'S CALLING PRGM. **XXX00050
      INTEGER   FROM,TO,F,D,P,R                                         XXX00060
      INTEGER   C                                                       XXX00070
      INTEGER   BT,PT,PAS,RTN,LPR,H,U,ARC,X,PCAND                       XXX00080
      DIMENSION P(1),F(1),D(1),U(1),ARC(1),X(1),R(1)                    XXX00090
      DIMENSION FROM(1),TO(1),C(1),H(1)                                 XXX00100
      DIMENSION PCAND(1)                                                XXX00110
      DIMENSION RTN(20),LPR(12),RTT(2)                                  XXX00120
      COMMON /A/FROM/B/TO/C/C/D/H/E/P/F/F/G/D/H/U/I/ARC/J/X/K/R/N/PCAND XXX00130
      COMMON /L/BT,MW,PT,M,N,IRT,MXIT,FRQ,P0,PBAR,CP,PAS,RTN,LPR,RTT,   XXX00140
     *          NCAND                                                   XXX00150
      DIMENSION IREVFL(4)                                               XXX00160
      COMMON /M/IREVFL,KARC,ICOM,ITH,MAXF,LNOD,MIC,MAC,NPE,IT,IT0,LGAM, XXX00170
     *          ISDB,TE0                                                XXX00180
C***** END OF RNET-STANDARD COMMON BLOCK *******************************XXX00190
C BOOTSTRAP SUBROUTINE FOR CONTINUING                                   NT000200
C SIMPLEX ITERATIONS FROM WHERE LEFT OFF.                               NT000210
      IFLAG=1                                                           NT000220
      CALL RNET1(IFLAG)                                                 NT000230
      RETURN                                                            NT000240
      END                                                               NT000250
      SUBROUTINE RNCHK(ITMJ,ITMJD,ITMI,                                 CHK00010
     *                            NIRTN)                                CHK00020
C***** START OF RNET-STANDARD COMMON BLOCK *****************************XXX00030
C** COMMON: M-LONG ARRAYS: P,F,D,U,ARC,X,R; N-LONG: FROM,TO,C,H; PCAND**XXX00040
C** SIZE OF THESE ARRAYS MUST BE DECLARED IN THE USER'S CALLING PRGM. **XXX00050
      INTEGER   FROM,TO,F,D,P,R                                         XXX00060
      INTEGER   C                                                       XXX00070
      INTEGER   BT,PT,PAS,RTN,LPR,H,U,ARC,X,PCAND                       XXX00080
      DIMENSION P(1),F(1),D(1),U(1),ARC(1),X(1),R(1)                    XXX00090
      DIMENSION FROM(1),TO(1),C(1),H(1)                                 XXX00100
      DIMENSION PCAND(1)                                                XXX00110
      DIMENSION RTN(20),LPR(12),RTT(2)                                  XXX00120
      COMMON /A/FROM/B/TO/C/C/D/H/E/P/F/F/G/D/H/U/I/ARC/J/X/K/R/N/PCAND XXX00130
      COMMON /L/BT,MW,PT,M,N,IRT,MXIT,FRQ,P0,PBAR,CP,PAS,RTN,LPR,RTT,   XXX00140
     *          NCAND                                                   XXX00150
      DIMENSION IREVFL(4)                                               XXX00160
      COMMON /M/IREVFL,KARC,ICOM,ITH,MAXF,LNOD,MIC,MAC,NPE,IT,IT0,LGAM, XXX00170
     *          ISDB,TE0                                                XXX00180
C***** END OF RNET-STANDARD COMMON BLOCK *******************************XXX00190
CHECKS OPTIMALITY/FEASIBILITY ACCORDING                                 CHK00200
C TO THE 'GRADUAL PENALTY' METHOD.                                      CHK00210
      NIRTN=1                                                           CHK00220
C                                                                       CHK00230
C FIRST, COMPUTE TRIAL PENALTY:                                         CHK00240
      MCLO=IABS(MIC)                                                    CHK00250
      MCHI=IABS(MAC)                                                    CHK00260
      MAGNC=MAX0(MCLO,MCHI)                                             CHK00270
100   CALL RNPENY(PTRY,NPENC,NPAS,NUMRTN)                               CHK00280
      GOTO(101,155,910),NUMRTN                                          CHK00290
101   PENC=NPENC                                                        CHK00300
C NEXT, EXAMINE SOLUTION FOR ARTIFCLS:                                  CHK00310
110   NART=0                                                            CHK00320
      NPART=0                                                           CHK00330
      DO 130 I=1,M                                                      CHK00340
       IF(ARC(I).NE.0)GOTO130                                           CHK00350
       IF(I.EQ.IRT)GOTO130                                              CHK00360
       NART=NART+1                                                      CHK00370
       IF(X(I).EQ.0)GOTO130                                             CHK00380
C POS ARTFL]; IF PREV 'NPE'.GT.M, NFS                                   CHK00390
       IF(NPE/M.GE.MAGNC)GOTO170                                        CHK00400
       IF(RTN(7).NE.0)GOTO120                                           CHK00410
C SAVE NUMBER OF ITERS FOR 1ST PASS:                                    CHK00420
       RTN(7)=ITMJ                                                      CHK00430
       RTN(8)=ITMJD                                                     CHK00440
       RTN(9)=ITMI                                                      CHK00450
C MACHINE WORDLGNTH SUFFICNT FOR WORST                                  CHK00460
C  -CASE MAXIMUM DUAL W/ NEW PENALTY?                                   CHK00470
C I.E. IF(NPENC*(2*M-1). LT. MW), OK:                                   CHK00480
120    MW0=MW/(2*M-1)                                                   CHK00490
       W1=MW-MW0*(2*M-1)                                                CHK00500
       W1=W1/(2*M-1)                                                    CHK00510
       IF((PENC-MW0).LE.W1)GOTO160                                      CHK00520
C NO; COUNT NUMBER OF POS BASIC ARTFLS                                  CHK00530
       NPART=NPART+1                                                    CHK00540
130   CONTINUE                                                          CHK00550
C ANY POSITIVE ARTIFICIALS BASIC?                                       CHK00560
      IF(NPART.GT.0)GOTO140                                             CHK00570
C NO;  OPTIMAL SOLUTION ACHIEVED:                                       CHK00580
      RTN(1)=0                                                          CHK00590
      NIRTN=3                                                           CHK00600
      GOTO1000                                                          CHK00610
C YES; IS MAX RED CST.LT.MACH WRDLGTH?                                  CHK00620
C (BASED ON NUMBER OF BASIC ARTIFICLS)                                  CHK00630
140   CM=MAGNC                                                          CHK00640
      MW0=MW/M                                                          CHK00650
      W1=MW-MW0*M                                                       CHK00660
      W1=W1/M                                                           CHK00670
      XLU=NART*PENC/M+(M-NART-1)*CM/M                                   CHK00680
      IF((2.*XLU-MW0).LE.W1)GOTO160                                     CHK00690
C NO. IS MAX RED CST.LT.MACH WRDLGTH?                                   CHK00700
C (BASED ON ACTUAL MAXIMUM TREE DEPTH)                                  CHK00710
      MXD=0                                                             CHK00720
      DO 150 I=1,M                                                      CHK00730
       IF(D(I).GT.MXD)MXD=D(I)                                          CHK00740
150   CONTINUE                                                          CHK00750
      XMD=2*MXD-1                                                       CHK00760
      IF(PENC.LE.MW/XMD)GOTO160                                         CHK00770
C NO. GIVE UP, DECLARE INFEASIBLE:                                      CHK00780
155   RTN(1)=20                                                         CHK00790
      RTN(11)=NPART                                                     CHK00800
      NIRTN=3                                                           CHK00810
      GOTO1000                                                          CHK00820
C OK TO INCREASE PENLTY; GOTO NEXT PASS                                 CHK00830
160   CP=PTRY                                                           CHK00840
      NPE=NPENC                                                         CHK00850
      PAS=NPAS                                                          CHK00860
      CALL RNDUL1                                                       CHK00870
      NIRTN=2                                                           CHK00880
      GOTO1000                                                          CHK00890
C DEFINITELY NO FEASIBLE SOLUTION:                                      CHK00900
170   RTN(1)=10                                                         CHK00910
      NIRTN=3                                                           CHK00920
      GOTO1000                                                          CHK00930
COST RANGE TOO LARGE FOR 'BT'                                           CHK00940
910   NIRTN=4                                                           CHK00950
1000  RETURN                                                            CHK00960
      END                                                               CHK00970
      SUBROUTINE RNCYCL(LENCYC,ICYCST,                                  YCL00010
     *                         NUMRTN)                                  YCL00020
C***** START OF RNET-STANDARD COMMON BLOCK *****************************XXX00030
C** COMMON: M-LONG ARRAYS: P,F,D,U,ARC,X,R; N-LONG: FROM,TO,C,H; PCAND**XXX00040
C** SIZE OF THESE ARRAYS MUST BE DECLARED IN THE USER'S CALLING PRGM. **XXX00050
      INTEGER   FROM,TO,F,D,P,R                                         XXX00060
      INTEGER   C                                                       XXX00070
      INTEGER   BT,PT,PAS,RTN,LPR,H,U,ARC,X,PCAND                       XXX00080
      DIMENSION P(1),F(1),D(1),U(1),ARC(1),X(1),R(1)                    XXX00090
      DIMENSION FROM(1),TO(1),C(1),H(1)                                 XXX00100
      DIMENSION PCAND(1)                                                XXX00110
      DIMENSION RTN(20),LPR(12),RTT(2)                                  XXX00120
      COMMON /A/FROM/B/TO/C/C/D/H/E/P/F/F/G/D/H/U/I/ARC/J/X/K/R/N/PCAND XXX00130
      COMMON /L/BT,MW,PT,M,N,IRT,MXIT,FRQ,P0,PBAR,CP,PAS,RTN,LPR,RTT,   XXX00140
     *          NCAND                                                   XXX00150
      DIMENSION IREVFL(4)                                               XXX00160
      COMMON /M/IREVFL,KARC,ICOM,ITH,MAXF,LNOD,MIC,MAC,NPE,IT,IT0,LGAM, XXX00170
     *          ISDB,TE0                                                XXX00180
C***** END OF RNET-STANDARD COMMON BLOCK *******************************XXX00190
C IDENTIFIES NEGATIVE CYCLE.                                            YCL00200
C INPUT ARGUMENTS : ICOM, KARC.                                         YCL00210
C OUTPUT ARGUMENTS: LENCYC,ICYCST,'U'.                                  YCL00220
C RETURN 1 = ARTFCL ARC IN CYCLE.                                       YCL00230
C RETURN 2 = ARC IN CYCLE W/ INFIN.FLOW                                 YCL00231
C LENCYC   = TOT.NO. OF ARCS IN CYCLE.                                  YCL00240
C ICYCST   = TOT. COST OF THE CYCLE.                                    YCL00250
C ARRAY 'U'= LIST OF ARC-IDS IN CYCLE.                                  YCL00260
      NUMRTN=0                                                          YCL00270
      ICYCST=C(KARC)                                                    YCL00280
      LENCYC=1                                                          YCL00290
      U(1)=KARC                                                         YCL00300
      NODE=FROM(KARC)                                                   YCL00310
10    NEXT=NODE                                                         YCL00320
20      IF(NEXT.EQ.ICOM)GOTO30                                          YCL00330
          LENCYC=LENCYC+1                                               YCL00340
          IARC=ARC(NEXT)                                                YCL00350
          U(LENCYC)=IARC                                                YCL00361
          IF(X(NEXT).EQ.MW)NUMRTN=2                                     YCL00371
          NCOST=NPE                                                     YCL00381
          IF(IARC.NE.0)NCOST=C(IARC)                                    YCL00382
          IF(IARC.EQ.0)NUMRTN=1                                         YCL00383
          ICYCST=ICYCST+NCOST                                           YCL00384
          NEXT=F(NEXT)                                                  YCL00390
          NEXT=IABS(NEXT)                                               YCL00400
        GOTO20                                                          YCL00410
30      IF(NODE.EQ.TO(KARC))GOTO1000                                    YCL00420
        NODE=TO(KARC)                                                   YCL00430
      GOTO10                                                            YCL00440
1000  RETURN                                                            YCL00460
      END                                                               YCL00470
      SUBROUTINE RNINIT(NUMRTN)                                         NIT00010
C                                                                       NIT00020
C***** START OF RNET-STANDARD COMMON BLOCK *****************************XXX00030
C** COMMON: M-LONG ARRAYS: P,F,D,U,ARC,X,R; N-LONG: FROM,TO,C,H; PCAND**XXX00040
C** SIZE OF THESE ARRAYS MUST BE DECLARED IN THE USER'S CALLING PRGM. **XXX00050
      INTEGER   FROM,TO,F,D,P,R                                         XXX00060
      INTEGER   C                                                       XXX00070
      INTEGER   BT,PT,PAS,RTN,LPR,H,U,ARC,X,PCAND                       XXX00080
      DIMENSION P(1),F(1),D(1),U(1),ARC(1),X(1),R(1)                    XXX00090
      DIMENSION FROM(1),TO(1),C(1),H(1)                                 XXX00100
      DIMENSION PCAND(1)                                                XXX00110
      DIMENSION RTN(20),LPR(12),RTT(2)                                  XXX00120
      COMMON /A/FROM/B/TO/C/C/D/H/E/P/F/F/G/D/H/U/I/ARC/J/X/K/R/N/PCAND XXX00130
      COMMON /L/BT,MW,PT,M,N,IRT,MXIT,FRQ,P0,PBAR,CP,PAS,RTN,LPR,RTT,   XXX00140
     *          NCAND                                                   XXX00150
      DIMENSION IREVFL(4)                                               XXX00160
      COMMON /M/IREVFL,KARC,ICOM,ITH,MAXF,LNOD,MIC,MAC,NPE,IT,IT0,LGAM, XXX00170
     *          ISDB,TE0                                                XXX00180
C***** END OF RNET-STANDARD COMMON BLOCK *******************************XXX00190
C INITLZ'N ROUTINE: CHECKS GIVEN DATA,                                  NIT00200
CONSTRUCTS ALL-ARTFL INITL BASIC SOL'N                                  NIT00210
C FOR 'GRADUAL PENALTY' METHOD; ALSO                                    NIT00220
COMPUTES MAX, MIN ARC COSTS, ETC.                                       NIT00230
      NUMRTN=0                                                          NIT00240
      IF(PT.LT.0.OR.PT.GT.1)GOTO940                                     NIT00250
COMPUTE MAXIMUM MAGNITUDE FOR INTEGER                                   NIT00260
      MW=(2**(BT-2)-1)*2+1                                              NIT00270
C INITLZE RTN, PRICING FREQ AND ROOT:                                   NIT00280
      PAS=0                                                             NIT00290
      NPE=0                                                             NIT00300
      DO 10 I=1,20                                                      NIT00310
10    RTN(I)=0                                                          NIT00320
      IF(NCAND.EQ.0)GOTO11                                              NIT00330
      IF(NCAND.LT.0.OR.NCAND.GT.N)GOTO945                               NIT00340
      IT=FRQ*NCAND*0.01+0.5                                             NIT00350
      GOTO12                                                            NIT00360
11    IT=FRQ*N*.01+0.5                                                  NIT00370
12    IT=MAX0(1,IT)                                                     NIT00380
      IF(IRT.LE.0.OR.IRT.GT.M)IRT=1                                     NIT00390
C ALL-ARTIFICIAL INITIAL BASIS:                                         NIT00400
      ISPLY=0                                                           NIT00410
      NDMND=0                                                           NIT00420
      DO 40 I=1,M                                                       NIT00430
        U(I)=0                                                          NIT00440
        F(I)=IRT                                                        NIT00450
        P(I)=I+1                                                        NIT00460
        IF(I.LT.M)R(I+1)=I                                              NIT00470
        D(I)=1                                                          NIT00480
        ARC(I)=0                                                        NIT00490
        IXI=X(I)                                                        NIT00500
        IF(IXI)20,40,30                                                 NIT00510
C DEMAND NODE:                                                          NIT00520
20      X(I)=-IXI                                                       NIT00530
        IF(NDMND.GE.MW+IXI)GOTO970                                      NIT00540
        NDMND=NDMND-IXI                                                 NIT00550
        GOTO40                                                          NIT00560
C SUPPLY NODE:                                                          NIT00570
30      IF(ISPLY.GE.MW-IXI)GOTO970                                      NIT00580
        ISPLY=ISPLY+IXI                                                 NIT00590
        F(I)=-IRT                                                       NIT00600
40    CONTINUE                                                          NIT00610
      X(IRT)=0                                                          NIT00620
      P(M)=IRT                                                          NIT00630
      R(IRT)=M                                                          NIT00640
      F(IRT)=0                                                          NIT00650
      D(IRT)=0                                                          NIT00660
      IF(IRT.EQ.1)GOTO50                                                NIT00670
      P(IRT)=1                                                          NIT00680
      R(1)=IRT                                                          NIT00690
      IF(IRT.EQ.M)GOTO50                                                NIT00700
      P(IRT-1)=IRT+1                                                    NIT00710
      R(IRT+1)=IRT-1                                                    NIT00720
CHECK GIVEN DATA; FIND MIN/MAX ARC COST                                 NIT00730
50    IF(ISPLY.NE.NDMND)GOTO950                                         NIT00740
      IF(ISPLY.NE.0.AND.PT.EQ.1)GOTO940                                 NIT00750
      IF(ISPLY.EQ.0.AND.PT.EQ.0)GOTO940                                 NIT00760
      MAC=-MW                                                           NIT00770
      MAH=-MW                                                           NIT00780
      MIC=MW                                                            NIT00790
      MIH=MW                                                            NIT00800
      NUMC=0                                                            NIT00810
      DO 60 J=1,N                                                       NIT00820
       ITO=TO(J)                                                        NIT00830
       IFR=FROM(J)                                                      NIT00840
CHECK OTIONAL PRICING CAND LIST:                                        NIT00850
       IF(NCAND.EQ.0)GOTO54                                             NIT00860
       IF(J.GT.NCAND)GOTO54                                             NIT00870
       IF(PCAND(J).LT.0)GOTO946                                         NIT00880
       IF(PCAND(J).GT.N)GOTO946                                         NIT00890
C                                                                       NIT00900
54     IF(H(J).GT.0)GOTO55                                              NIT00910
C H(J)=0 IMPLIES INFINITE CAP:                                          NIT00920
       IF(H(J).LT.0)GOTO900                                             NIT00930
       H(J)=MW                                                          NIT00940
55     JC=C(J)                                                          NIT00950
       JH=H(J)                                                          NIT00960
       IF(JC.NE.0)NUMC=NUMC+1                                           NIT00970
       IF(JC.GT.MAC)MAC=JC                                              NIT00980
       IF(JH.GT.MAH)MAH=JH                                              NIT00990
       IF(JC.GE.MIC)GOTO56                                              NIT01000
       MIC=JC                                                           NIT01010
       MCC=J                                                            NIT01020
56     IF(JH.LT.MIH)MIH=JH                                              NIT01030
       IF(IFR.GT.M.OR.ITO.GT.M)GOTO920                                  NIT01040
       IF(IFR.LE.0.OR.ITO.LE.0)GOTO920                                  NIT01050
       IF(IFR.EQ.ITO)GOTO920                                            NIT01060
C TALLY NODE DEGREES IN U (SCRATCH)                                     NIT01070
       U(ITO)=U(ITO)+1                                                  NIT01080
       U(IFR)=U(IFR)+1                                                  NIT01090
60    CONTINUE                                                          NIT01100
C                                                                       NIT01110
C FOR MAXFLO PROBLEMS, PUT THE CIRCL'TN                                 NIT01120
C ARC INTO THE INITIAL BASIS:                                           NIT01130
      IF(PT.NE.1)GOTO59                                                 NIT01140
      JF=FROM(MCC)                                                      NIT01150
      JT=TO(MCC)                                                        NIT01160
      IF(IRT.EQ.JF)GOTO57                                               NIT01170
      IF(IRT.EQ.JT)GOTO58                                               NIT01180
C IRT NOT SUPER SOURCE OR SUPER SINK:                                   NIT01190
      IPTS=P(JT)                                                        NIT01200
      IPFS=P(JF)                                                        NIT01210
      IRFS=R(JF)                                                        NIT01220
      P(IRFS)=IPFS                                                      NIT01230
      R(IPFS)=IRFS                                                      NIT01240
      F(JF)=-JT                                                         NIT01250
      ARC(JF)=MCC                                                       NIT01260
      P(JT)=JF                                                          NIT01270
      R(JF)=JT                                                          NIT01280
      D(JF)=2                                                           NIT01290
      IF(JF.EQ.IPTS)GOTO59                                              NIT01300
      P(JF)=IPTS                                                        NIT01310
      R(IPTS)=JF                                                        NIT01320
      GOTO59                                                            NIT01330
C HERE, IRT IS SAME AS SUPER SINK:                                      NIT01340
57    F(JT)=IRT                                                         NIT01350
      GOTO59                                                            NIT01360
C HERE, IRT IS SAME AS SUPER SOURCE:                                    NIT01370
58    F(JF)=-IRT                                                        NIT01380
C NOW, CHECK RANGE OF COSTS:                                            NIT01390
59    IF(MIC.GT.0)GOTO61                                                NIT01400
      IF(MAC.LT.0)GOTO61                                                NIT01410
      IF(IABS(MIC).LE.MW-MAC)GOTO61                                     NIT01420
      GOTO960                                                           NIT01430
C RETURN MIN/MAX OF COSTS AND BOUNDS:                                   NIT01440
61    RTN(13)=MIC                                                       NIT01450
      RTN(14)=MAC                                                       NIT01460
      RTN(15)=MIH                                                       NIT01470
      RTN(16)=MAH                                                       NIT01480
CHECK FOR ZERO-DEGREE NODES:                                            NIT01490
      MAXDEG=0                                                          NIT01500
      MINDEG=MW                                                         NIT01510
      NUMDEG=0                                                          NIT01520
      DO 62 I=1,M                                                       NIT01530
       IUI=U(I)                                                         NIT01540
       IF(IUI.EQ.0)NUMDEG=NUMDEG+1                                      NIT01550
       IF(IUI.GT.MAXDEG)MAXDEG=IUI                                      NIT01560
       IF(IUI.LT.MINDEG)MINDEG=IUI                                      NIT01570
62    CONTINUE                                                          NIT01580
      RTN(17)=MINDEG                                                    NIT01590
      RTN(18)=MAXDEG                                                    NIT01600
      IF(NUMDEG.GT.0)GOTO980                                            NIT01610
CHECK PROBLEM TYPE AGAIN:                                               NIT01620
      IF((NUMC.NE.1.OR.MIC.NE.-1.OR.                                    NIT01630
     *MAC.NE.0).AND.PT.EQ.1)GOTO940                                     NIT01640
CHECK PBAR.GT.1.0?                                                      NIT01650
      IF(PBAR.LE.1.0)GOTO930                                            NIT01660
C                                                                       NIT01670
COMPUTE VALUES OF DUAL VARIABLES:                                       NIT01680
C FIRST COMPUTE PENALTY FOR ARTFLS:                                     NIT01690
      CALL RNPENY(CPN,NPN,NPAS,NNRTN)                                   NIT01700
      IF(NNRTN.NE.1)GOTO960                                             NIT01710
      CP=CPN                                                            NIT01720
      NPE=NPN                                                           NIT01730
      PAS=NPAS                                                          NIT01740
      CALL RNDUL1                                                       NIT01750
      GOTO1000                                                          NIT01760
C                                                                       NIT01770
C ERROR EXITS:                                                          NIT01780
900   RTN(1)=120                                                        NIT01790
      RTN(6)=H(J)                                                       NIT01800
910   RTN(2)=J                                                          NIT01810
      RTN(4)=IFR                                                        NIT01820
      RTN(5)=ITO                                                        NIT01830
      GOTO990                                                           NIT01840
920   RTN(1)=130                                                        NIT01850
      GOTO910                                                           NIT01860
930   RTN(1)=140                                                        NIT01870
      GOTO990                                                           NIT01880
940   RTN(1)=150                                                        NIT01890
      GOTO990                                                           NIT01900
945   RTN(1)=320                                                        NIT01910
      RTN(2)=NCAND                                                      NIT01920
      GOTO990                                                           NIT01930
946   RTN(1)=330                                                        NIT01940
      RTN(2)=NCAND                                                      NIT01950
      RTN(3)=J                                                          NIT01960
      RTN(4)=PCAND(J)                                                   NIT01970
      GOTO990                                                           NIT01980
950   RTN(1)=100                                                        NIT01990
      RTN(2)=ISPLY                                                      NIT02000
      RTN(4)=NDMND                                                      NIT02010
      GOTO990                                                           NIT02020
960   RTN(1)=160                                                        NIT02030
      RTN(2)=MIC                                                        NIT02040
      RTN(3)=MAC                                                        NIT02050
      GOTO990                                                           NIT02060
970   RTN(1)=110                                                        NIT02070
      GOTO990                                                           NIT02080
980   RTN(1)=170                                                        NIT02090
      RTN(2)=NUMDEG                                                     NIT02100
990   NUMRTN=1                                                          NIT02110
1000  RETURN                                                            NIT02120
      END                                                               NIT02130
      SUBROUTINE RNDUL1                                                 UL100010
C                                                                       UL100020
C***** START OF RNET-STANDARD COMMON BLOCK *****************************XXX00030
C** COMMON: M-LONG ARRAYS: P,F,D,U,ARC,X,R; N-LONG: FROM,TO,C,H; PCAND**XXX00040
C** SIZE OF THESE ARRAYS MUST BE DECLARED IN THE USER'S CALLING PRGM. **XXX00050
      INTEGER   FROM,TO,F,D,P,R                                         XXX00060
      INTEGER   C                                                       XXX00070
      INTEGER   BT,PT,PAS,RTN,LPR,H,U,ARC,X,PCAND                       XXX00080
      DIMENSION P(1),F(1),D(1),U(1),ARC(1),X(1),R(1)                    XXX00090
      DIMENSION FROM(1),TO(1),C(1),H(1)                                 XXX00100
      DIMENSION PCAND(1)                                                XXX00110
      DIMENSION RTN(20),LPR(12),RTT(2)                                  XXX00120
      COMMON /A/FROM/B/TO/C/C/D/H/E/P/F/F/G/D/H/U/I/ARC/J/X/K/R/N/PCAND XXX00130
      COMMON /L/BT,MW,PT,M,N,IRT,MXIT,FRQ,P0,PBAR,CP,PAS,RTN,LPR,RTT,   XXX00140
     *          NCAND                                                   XXX00150
      DIMENSION IREVFL(4)                                               XXX00160
      COMMON /M/IREVFL,KARC,ICOM,ITH,MAXF,LNOD,MIC,MAC,NPE,IT,IT0,LGAM, XXX00170
     *          ISDB,TE0                                                XXX00180
C***** END OF RNET-STANDARD COMMON BLOCK *******************************XXX00190
C ENTER HERE W/ KNOWN 'CP','NPE'.                                       UL100200
C NOW COMPUTE DUALS (ALL NODES):                                        UL100210
      I=IRT                                                             UL100220
      U(IRT)=0                                                          UL100230
10    I=P(I)                                                            UL100240
       IF(I.EQ.IRT)RETURN                                               UL100250
       IDI=ARC(I)                                                       UL100260
       NCOST=NPE                                                        UL100270
       IF(IDI.NE.0)NCOST=C(IDI)                                         UL100280
       NXT=F(I)                                                         UL100290
       IF(NXT.GE.0)NCOST=-NCOST                                         UL100300
       U(I)=U(IABS(NXT))+NCOST                                          UL100310
      GOTO10                                                            UL100320
      END                                                               UL100330
      SUBROUTINE RNPENY(CPN,NPY,NPAS,                                   ENY00010
     *                         NUMRTN)                                  ENY00020
C***** START OF RNET-STANDARD COMMON BLOCK *****************************XXX00030
C** COMMON: M-LONG ARRAYS: P,F,D,U,ARC,X,R; N-LONG: FROM,TO,C,H; PCAND**XXX00040
C** SIZE OF THESE ARRAYS MUST BE DECLARED IN THE USER'S CALLING PRGM. **XXX00050
      INTEGER   FROM,TO,F,D,P,R                                         XXX00060
      INTEGER   C                                                       XXX00070
      INTEGER   BT,PT,PAS,RTN,LPR,H,U,ARC,X,PCAND                       XXX00080
      DIMENSION P(1),F(1),D(1),U(1),ARC(1),X(1),R(1)                    XXX00090
      DIMENSION FROM(1),TO(1),C(1),H(1)                                 XXX00100
      DIMENSION PCAND(1)                                                XXX00110
      DIMENSION RTN(20),LPR(12),RTT(2)                                  XXX00120
      COMMON /A/FROM/B/TO/C/C/D/H/E/P/F/F/G/D/H/U/I/ARC/J/X/K/R/N/PCAND XXX00130
      COMMON /L/BT,MW,PT,M,N,IRT,MXIT,FRQ,P0,PBAR,CP,PAS,RTN,LPR,RTT,   XXX00140
     *          NCAND                                                   XXX00150
      DIMENSION IREVFL(4)                                               XXX00160
      COMMON /M/IREVFL,KARC,ICOM,ITH,MAXF,LNOD,MIC,MAC,NPE,IT,IT0,LGAM, XXX00170
     *          ISDB,TE0                                                XXX00180
C***** END OF RNET-STANDARD COMMON BLOCK *******************************XXX00190
C CPN= COMPOSITE MULTIPLIER FOR NEW PASS                                ENY00200
C NPY= NEW PENALTY FOR ARTIFICIALS.                                     ENY00210
C NPAS=NUMBER OF NEW (PROPOSED) PASS.                                   ENY00220
      NUMRTN=1                                                          ENY00230
      NPAS=PAS                                                          ENY00240
      ICHI=IABS(MAC)                                                    ENY00250
      ICLO=IABS(MIC)                                                    ENY00260
      CMAG=MAX0(ICHI,ICLO)                                              ENY00270
C     COST RANGE TOO LARGE FOR 'BT' BITS?                               ENY00280
      ISH=ISIGN(1,MAC)                                                  ENY00290
      ISL=ISIGN(1,MIC)                                                  ENY00300
      IF(ISH*ISL.GE.0)GOTO10                                            ENY00310
      IF(ICHI.LE.MW-ICLO)GOTO10                                         ENY00320
      RTN(1)=160                                                        ENY00330
      RTN(2)=MIC                                                        ENY00340
      RTN(3)=MAC                                                        ENY00350
      NUMRTN=3                                                          ENY00360
      GOTO1000                                                          ENY00370
10    NPAS=NPAS+1                                                       ENY00380
CHECK MAX MAGNITUDE OF CPN:                                             ENY00390
      IF(MAC.NE.MIC)GOTO100                                             ENY00400
      CPT=CMAG*(M-1)/(IABS(MIC)+1)                                      ENY00410
      GOTO200                                                           ENY00420
100   CPT=(CMAG*(M-1)-MIC)/(MAC-MIC)                                    ENY00430
200   IF(CPT.GE.MW)GOTO900                                              ENY00440
      PPW=1.                                                            ENY00450
      IF(NPAS.EQ.1)GOTO300                                              ENY00460
      IF(NPAS-2.GT.BT)GOTO900                                           ENY00470
      PWR=2.**(NPAS-2)                                                  ENY00480
      PPW=PBAR**PWR                                                     ENY00490
      IF(PPW.GE.MW)GOTO900                                              ENY00500
COMPUTED CPN AND NPY:                                                   ENY00510
300   CPN=P0*PPW                                                        ENY00520
      IF(CPN.GT.CPT)CPN=CPT                                             ENY00530
      PENTRY=(MAC-MIC)*CPN+MIC                                          ENY00540
      IF(MAC.EQ.MIC)                                                    ENY00550
     *         PENTRY=CPN*(IABS(MIC)+1)                                 ENY00560
      NPY=PENTRY+0.5                                                    ENY00570
      IF(NPY.GT.NPE)GOTO1000                                            ENY00580
      GOTO10                                                            ENY00590
CAN'T INCREASE PENALTY FURTHER:                                         ENY00600
900   NPAS=NPAS-1                                                       ENY00610
      CPN=CP                                                            ENY00620
      NPY=NPE                                                           ENY00630
      NUMRTN=2                                                          ENY00640
1000  RETURN                                                            ENY00650
      END                                                               ENY00660
      SUBROUTINE RNATL(NUMRTN)                                          ATL00010
C                                                                       ATL00020
C***** START OF RNET-STANDARD COMMON BLOCK *****************************XXX00030
C** COMMON: M-LONG ARRAYS: P,F,D,U,ARC,X,R; N-LONG: FROM,TO,C,H; PCAND**XXX00040
C** SIZE OF THESE ARRAYS MUST BE DECLARED IN THE USER'S CALLING PRGM. **XXX00050
      INTEGER   FROM,TO,F,D,P,R                                         XXX00060
      INTEGER   C                                                       XXX00070
      INTEGER   BT,PT,PAS,RTN,LPR,H,U,ARC,X,PCAND                       XXX00080
      DIMENSION P(1),F(1),D(1),U(1),ARC(1),X(1),R(1)                    XXX00090
      DIMENSION FROM(1),TO(1),C(1),H(1)                                 XXX00100
      DIMENSION PCAND(1)                                                XXX00110
      DIMENSION RTN(20),LPR(12),RTT(2)                                  XXX00120
      COMMON /A/FROM/B/TO/C/C/D/H/E/P/F/F/G/D/H/U/I/ARC/J/X/K/R/N/PCAND XXX00130
      COMMON /L/BT,MW,PT,M,N,IRT,MXIT,FRQ,P0,PBAR,CP,PAS,RTN,LPR,RTT,   XXX00140
     *          NCAND                                                   XXX00150
      DIMENSION IREVFL(4)                                               XXX00160
      COMMON /M/IREVFL,KARC,ICOM,ITH,MAXF,LNOD,MIC,MAC,NPE,IT,IT0,LGAM, XXX00170
     *          ISDB,TE0                                                XXX00180
C***** END OF RNET-STANDARD COMMON BLOCK *******************************XXX00190
C OBTAINS FAP(KARC),FINDS 'ARC(LNOD)'                                   ATL00200
C TO LEAVE THE BASIS TREE AND COMPUTES                                  ATL00210
C THE FLOW AUGMENTATN ALONG FAP(KARC),                                  ATL00220
C WHERE 'KARC' IS THE ENTERING ARC.                                     ATL00230
C DEGENERATE STEP RETURNS NUMRTN=1.                                     ATL00241
C INITIALIZE                                                            ATL00250
      NUMRTN=0                                                          ATL00260
      KFR=FROM(KARC)                                                    ATL00270
      KTO=TO(KARC)                                                      ATL00280
      ITH=3                                                             ATL00290
      KBND=-1                                                           ATL00300
      IF(H(KARC).LT.0)KBND=1                                            ATL00310
      MAXF=IABS(H(KARC))                                                ATL00320
      IDP=D(KFR)-D(KTO)                                                 ATL00330
      IF(IDP)20,230,10                                                  ATL00340
C 'FROM'-SIDE IS DEEPER:                                                ATL00350
10    IEPS=-KBND                                                        ATL00360
      IJGAM=1                                                           ATL00370
      NODE=KFR                                                          ATL00380
      GOTO30                                                            ATL00390
C 'TO'-SIDE IS DEEPER:                                                  ATL00400
20    IEPS=KBND                                                         ATL00410
      IDP=-IDP                                                          ATL00420
      IJGAM=0                                                           ATL00430
      NODE=KTO                                                          ATL00440
C TRAVERSE UP AND SEEK ARC TO LEAVE:                                    ATL00450
30    DO 100 JJ=1,IDP                                                   ATL00460
        IDARC=ARC(NODE)                                                 ATL00470
        IDIR=1                                                          ATL00480
        IF(F(NODE).LT.0)IDIR=-1                                         ATL00490
        IF(IDIR.EQ.IEPS)GOTO70                                          ATL00500
C 1ST CASE OF FLOW FOR ARC IN FAP:                                      ATL00510
50      IFLOI=X(NODE)                                                   ATL00520
        IF(MAXF.LT.IFLOI)GOTO90                                         ATL00530
        IF(MAXF.NE.IFLOI)GOTO60                                         ATL00540
        IF(IDARC.EQ.0)GOTO60                                            ATL00550
        GOTO90                                                          ATL00560
55      IFLOI=0                                                         ATL00570
C LEAVING ARC 'ARC(LNOD)' AT L.B.:                                      ATL00580
60      ITH=1                                                           ATL00590
        GOTO80                                                          ATL00600
C 2ND-4TH CASES OF FLOW FOR FAP ARC:                                    ATL00610
70      IF(IDARC.NE.0)GOTO75                                            ATL00620
C ARTIFICIAL ARC (3RD-4TH CASES):                                       ATL00630
        IF(X(NODE).EQ.0)GOTO55                                          ATL00640
        GOTO90                                                          ATL00650
C 2ND CASE OF FLOW FOR ARC IN FAP:                                      ATL00660
75      IFLOI=IABS(H(IDARC))-X(NODE)                                    ATL00670
        IF(MAXF.LE.IFLOI)GOTO90                                         ATL00680
C LEAVING ARC 'ARC(LNOD)' AT CAPACITY:                                  ATL00690
        ITH=2                                                           ATL00700
80      MAXF=IFLOI                                                      ATL00710
        LNOD=NODE                                                       ATL00720
        LGAM=IJGAM                                                      ATL00730
90      NODE=F(NODE)                                                    ATL00740
        NODE=IABS(NODE)                                                 ATL00750
C TRUNCATE COMPT'N IF FLOW AUGMNT'N=0:                                  ATL00760
        IF(MAXF.EQ.0)GOTO140                                            ATL00770
100   CONTINUE                                                          ATL00780
C ON WHICH SIDE OF FAP IS NODE 'NODE'?                                  ATL00790
110   IF(IJGAM.EQ.1)GOTO120                                             ATL00800
C ON THE 'TO' SIDE:                                                     ATL00810
      KTO=NODE                                                          ATL00820
      GOTO130                                                           ATL00830
C ON THE 'FROM' SIDE:                                                   ATL00840
120   KFR=NODE                                                          ATL00850
130   IF(KTO.EQ.KFR)GOTO395                                             ATL00860
      IF(MAXF.EQ.0)GOTO430                                              ATL00870
      GOTO230                                                           ATL00880
C TRAVERSE FAP(KARC) W/O FLOW COMPUTN:                                  ATL00890
140   IF(JJ.EQ.IDP)GOTO110                                              ATL00900
C RUN UP ONE SIDE OF FAP TO SAME DEPTH                                  ATL00910
      JJ=JJ+1                                                           ATL00920
       DO 150 JJJ=JJ,IDP                                                ATL00930
         NODE=F(NODE)                                                   ATL00940
150      NODE=IABS(NODE)                                                ATL00950
      GOTO110                                                           ATL00960
C DEPTHS EQUAL. NOW TRAVERSE FAP(KARC)                                  ATL00970
C SIMULTANEOUSLY ON BOTH SIDES:                                         ATL00980
C 1) MOVE ONE LEVEL UP ON 'TO' SIDE:                                    ATL00990
C    (SAME LOGIC AS DO 100 LOOP ABOVE)                                  ATL01000
230   IDIR=1                                                            ATL01010
       IF(F(KTO).LT.0)IDIR=-1                                           ATL01020
       IDARC=ARC(KTO)                                                   ATL01030
       IF(IDIR.EQ.KBND)GOTO270                                          ATL01040
       IFLOI=X(KTO)                                                     ATL01050
       IF(MAXF.LT.IFLOI)GOTO290                                         ATL01060
       IF(MAXF.NE.IFLOI)GOTO260                                         ATL01070
       IF(IDARC.EQ.0)GOTO260                                            ATL01080
       GOTO290                                                          ATL01090
255    IFLOI=0                                                          ATL01100
260    ITH=1                                                            ATL01110
       GOTO280                                                          ATL01120
270    IF(IDARC.NE.0)GOTO275                                            ATL01130
       IF(X(KTO).EQ.0)GOTO255                                           ATL01140
       GOTO290                                                          ATL01150
275    IFLOI=IABS(H(IDARC))-X(KTO)                                      ATL01160
       IF(MAXF.LE.IFLOI)GOTO290                                         ATL01170
       ITH=2                                                            ATL01180
280    MAXF=IFLOI                                                       ATL01190
       LGAM=0                                                           ATL01200
       LNOD=KTO                                                         ATL01210
290    KTO=F(KTO)                                                       ATL01220
       KTO=IABS(KTO)                                                    ATL01230
       IF(MAXF.EQ.0)GOTO390                                             ATL01240
C 2) MOVE ONE LEVEL UP ON 'FROM' SIDE:                                  ATL01250
C    (SAME LOGIC AS DO 100 LOOP ABOVE)                                  ATL01260
       IDIR=1                                                           ATL01270
       IF(F(KFR).LT.0)IDIR=-1                                           ATL01280
       IDARC=ARC(KFR)                                                   ATL01290
       IF(IDIR.NE.KBND)GOTO370                                          ATL01300
       IFLOI=X(KFR)                                                     ATL01310
       IF(MAXF.LT.IFLOI)GOTO390                                         ATL01320
       IF(MAXF.NE.IFLOI)GOTO360                                         ATL01330
       IF(IDARC.EQ.0)GOTO360                                            ATL01340
       GOTO390                                                          ATL01350
355    IFLOI=0                                                          ATL01360
360    ITH=1                                                            ATL01370
       GOTO380                                                          ATL01380
370    IF(IDARC.NE.0)GOTO375                                            ATL01390
       IF(X(KFR).EQ.0)GOTO355                                           ATL01400
       GOTO390                                                          ATL01410
375    IFLOI=IABS(H(IDARC))-X(KFR)                                      ATL01420
       IF(MAXF.LE.IFLOI)GOTO390                                         ATL01430
       ITH=2                                                            ATL01440
380    MAXF=IFLOI                                                       ATL01450
       LGAM=1                                                           ATL01460
       LNOD=KFR                                                         ATL01470
390    KFR=F(KFR)                                                       ATL01480
       KFR=IABS(KFR)                                                    ATL01490
       IF(MAXF.EQ.0)GOTO420                                             ATL01500
      IF(KFR.NE.KTO)GOTO230                                             ATL01510
COMMON NODE FOUND; SAVE & RETURN:                                       ATL01520
395   ICOM=KFR                                                          ATL01530
      GOTO500                                                           ATL01540
CONTINUE WITH FAP UNTIL COMMON NODE:                                    ATL01550
420   IF(KFR.EQ.KTO)GOTO395                                             ATL01560
430   KFR=F(KFR)                                                        ATL01570
      KFR=IABS(KFR)                                                     ATL01580
      KTO=F(KTO)                                                        ATL01590
      KTO=IABS(KTO)                                                     ATL01600
      GOTO420                                                           ATL01610
C IF MAXF=0, DO THE UPDATE OF FLOWS &                                   ATL01620
C FLOW STATUS HERE AND RETURN NUMRTN=1.                                 ATL01631
500   IF(MAXF.GT.0)GOTO1000                                             ATL01640
      IF(H(KARC).GE.0)GOTO520                                           ATL01650
      H(KARC)=-H(KARC)                                                  ATL01660
      MAXF=H(KARC)                                                      ATL01670
520   IF(ITH.EQ.2)GOTO530                                               ATL01680
      IF(ITH.EQ.3)H(KARC)=-H(KARC)                                      ATL01690
      GOTO990                                                           ATL01700
530   IDK=ARC(LNOD)                                                     ATL01710
      H(IDK)=-H(IDK)                                                    ATL01720
990   NUMRTN=1                                                          ATL01730
1000  RETURN                                                            ATL01740
      END                                                               ATL01750
      SUBROUTINE RNUPDF(NUMRTN)                                         PDF00010
C                                                                       PDF00020
C***** START OF RNET-STANDARD COMMON BLOCK *****************************XXX00030
C** COMMON: M-LONG ARRAYS: P,F,D,U,ARC,X,R; N-LONG: FROM,TO,C,H; PCAND**XXX00040
C** SIZE OF THESE ARRAYS MUST BE DECLARED IN THE USER'S CALLING PRGM. **XXX00050
      INTEGER   FROM,TO,F,D,P,R                                         XXX00060
      INTEGER   C                                                       XXX00070
      INTEGER   BT,PT,PAS,RTN,LPR,H,U,ARC,X,PCAND                       XXX00080
      DIMENSION P(1),F(1),D(1),U(1),ARC(1),X(1),R(1)                    XXX00090
      DIMENSION FROM(1),TO(1),C(1),H(1)                                 XXX00100
      DIMENSION PCAND(1)                                                XXX00110
      DIMENSION RTN(20),LPR(12),RTT(2)                                  XXX00120
      COMMON /A/FROM/B/TO/C/C/D/H/E/P/F/F/G/D/H/U/I/ARC/J/X/K/R/N/PCAND XXX00130
      COMMON /L/BT,MW,PT,M,N,IRT,MXIT,FRQ,P0,PBAR,CP,PAS,RTN,LPR,RTT,   XXX00140
     *          NCAND                                                   XXX00150
      DIMENSION IREVFL(4)                                               XXX00160
      COMMON /M/IREVFL,KARC,ICOM,ITH,MAXF,LNOD,MIC,MAC,NPE,IT,IT0,LGAM, XXX00170
     *          ISDB,TE0                                                XXX00180
C***** END OF RNET-STANDARD COMMON BLOCK *******************************XXX00190
C UPDATES FLOWS FOR ARCS IN FAP(KARC)                                   PDF00200
C INFINITE SOLUTION RETURNS NUMRTN=1.                                   PDF00211
C (NOTE: INF SOL'N IS DUE TO -VE CYCLE)                                 PDF00220
      NUMRTN=0                                                          PDF00230
C (MAXF=FLOW AUGMENTATION ON ARC KARC)                                  PDF00240
      IFLOJ=MAXF                                                        PDF00250
      IF(MAXF.GE.MW)GOTO990                                             PDF00270
      IF(H(KARC).GE.0)GOTO20                                            PDF00280
C INCOMING ARC 'KARC' N.B. AT CAPACTY:                                  PDF00290
      H(KARC)=-H(KARC)                                                  PDF00300
      MAXF=-MAXF                                                        PDF00310
      IFLOJ=H(KARC)+MAXF                                                PDF00320
      IF(ITH.NE.2)GO TO 30                                              PDF00330
C ITH=2:SET LEAVING ARC N.B. AT CAP:                                    PDF00340
10    IDK=ARC(LNOD)                                                     PDF00350
      IF(H(IDK).GE.MW)GOTO990                                           PDF00360
      H(IDK)=-H(IDK)                                                    PDF00370
      GOTO30                                                            PDF00380
C INCOMING ARC 'KARC' AT LOWERBND (0):                                  PDF00390
20    IF(ITH.EQ.1)GO TO 30                                              PDF00400
      IF(ITH.EQ.2)GO TO 10                                              PDF00410
C ITH=3:SET INCOMNG ARC N.B. AT CAP:                                    PDF00420
      IF(H(KARC).GE.MW)GOTO990                                          PDF00430
      H(KARC)=-H(KARC)                                                  PDF00440
C TRAVERSE FAP(KARC) AND UPDATE FLOWS:                                  PDF00450
30    IF(MAXF.EQ.0)GOTO60                                               PDF00460
      I=FROM(KARC)                                                      PDF00470
      IAF=MAXF                                                          PDF00480
40    IF(I.EQ.ICOM)GOTO50                                               PDF00490
       IP=F(I)                                                          PDF00500
       X(I)=X(I)+IAF*ISIGN(1,IP)                                        PDF00510
       IF(X(I).GE.MW)GOTO990                                            PDF00520
       I=IABS(IP)                                                       PDF00530
      GOTO40                                                            PDF00540
50    IF(IAF.EQ.-MAXF)GOTO60                                            PDF00550
       IAF=-IAF                                                         PDF00560
       I=TO(KARC)                                                       PDF00570
      GOTO40                                                            PDF00580
C MAXF NOW IS ACTUAL FLOW IN 'KARC':                                    PDF00590
60    MAXF=IFLOJ                                                        PDF00600
1000  RETURN                                                            PDF00610
C INFINITE SOLN (I.E. -VE CYCLE FOUND)                                  PDF00620
990   NUMRTN=1                                                          PDF00630
      GOTO1000                                                          PDF00640
      END                                                               PDF00650
      SUBROUTINE RNPIVT                                                 IVT00010
C                                                                       IVT00020
C***** START OF RNET-STANDARD COMMON BLOCK *****************************XXX00030
C** COMMON: M-LONG ARRAYS: P,F,D,U,ARC,X,R; N-LONG: FROM,TO,C,H; PCAND**XXX00040
C** SIZE OF THESE ARRAYS MUST BE DECLARED IN THE USER'S CALLING PRGM. **XXX00050
      INTEGER   FROM,TO,F,D,P,R                                         XXX00060
      INTEGER   C                                                       XXX00070
      INTEGER   BT,PT,PAS,RTN,LPR,H,U,ARC,X,PCAND                       XXX00080
      DIMENSION P(1),F(1),D(1),U(1),ARC(1),X(1),R(1)                    XXX00090
      DIMENSION FROM(1),TO(1),C(1),H(1)                                 XXX00100
      DIMENSION PCAND(1)                                                XXX00110
      DIMENSION RTN(20),LPR(12),RTT(2)                                  XXX00120
      COMMON /A/FROM/B/TO/C/C/D/H/E/P/F/F/G/D/H/U/I/ARC/J/X/K/R/N/PCAND XXX00130
      COMMON /L/BT,MW,PT,M,N,IRT,MXIT,FRQ,P0,PBAR,CP,PAS,RTN,LPR,RTT,   XXX00140
     *          NCAND                                                   XXX00150
      DIMENSION IREVFL(4)                                               XXX00160
      COMMON /M/IREVFL,KARC,ICOM,ITH,MAXF,LNOD,MIC,MAC,NPE,IT,IT0,LGAM, XXX00170
     *          ISDB,TE0                                                XXX00180
C***** END OF RNET-STANDARD COMMON BLOCK *******************************XXX00190
C PIVOT TO EXCHANGE ARC 'ARC(LNOD)' W/                                  IVT00200
C ARC 'KARC'; DONE BY UPDATING LIST                                     IVT00210
C FUNCTIONS WHICH DESCRIBE THE BASIS.                                   IVT00220
C NRK=ROOT OF SUBTREE TO BE ORDERED                                     IVT00230
C NSR=THE NEW FIRST SON OF NRK                                          IVT00240
C IQ =NODE SUCH THAT P(IQ)=LNOD                                         IVT00250
C'STEM'=PATH FROM NODE 'NSR' TO 'LNOD'                                  IVT00260
      IF(LGAM.EQ.1)GOTO10                                               IVT00270
      NSR=TO(KARC)                                                      IVT00280
      NRK=FROM(KARC)                                                    IVT00290
      GOTO20                                                            IVT00300
10    NSR=FROM(KARC)                                                    IVT00310
      NRK=TO(KARC)                                                      IVT00320
20    CONTINUE                                                          IVT00330
C NEXT 5 LINES FIND IQ W/O 'R' FUNCN:                                   IVT00340
C     IQ=F(LNOD)                                                        IVT00350
C     IQ=IABS(IQ)                                                       IVT00360
C30   IF(P(IQ).EQ.LNOD)GOTO40                                           IVT00370
C       IQ=P(IQ)                                                        IVT00380
C     GOTO30                                                            IVT00390
C NEXT LINE FINDS Q VIA THE 'R' FNCTN:                                  IVT00400
      IQ=R(LNOD)                                                        IVT00410
C SAVE INFO FOR NSR,NRK & PUT NEW VALS                                  IVT00420
40    LF=F(NSR)                                                         IVT00430
      IDIR1=1                                                           IVT00440
      IF(LF.LT.0)IDIR1=-1                                               IVT00450
      LF=IABS(LF)                                                       IVT00460
      IFLO1=X(NSR)                                                      IVT00470
      ID1=ARC(NSR)                                                      IVT00480
      F(NSR)=NRK                                                        IVT00490
      IF(LGAM.EQ.1)F(NSR)=-F(NSR)                                       IVT00500
      X(NSR)=MAXF                                                       IVT00510
      ARC(NSR)=KARC                                                     IVT00520
      ISDPTH=D(NSR)                                                     IVT00530
      IDIR=1                                                            IVT00540
      IF(F(NSR).GE.0)IDIR=-1                                            IVT00550
C DIFF BETWN NEW & OLD DUALS, DEPTHS:                                   IVT00560
      IDELU=U(NRK)+IDIR*C(KARC)-U(NSR)                                  IVT00570
      IDELD=D(NRK)+1-D(NSR)                                             IVT00580
C INIT LOOP VARS: I=CURNT NODE IN SCAN                                  IVT00590
C IS=STEMNODE;LR=PREVSLY SCAND STMNODE                                  IVT00600
      LR=P(NSR)                                                         IVT00610
      ISAV=P(NRK)                                                       IVT00620
      J=LR                                                              IVT00630
      I=NRK                                                             IVT00640
      IS=NSR                                                            IVT00650
C TRAVRSE ALL NODES IN SUBTREE BY TRA-                                  IVT00660
C VERSING ALL DESCNDTS OF EACH STEMNOD                                  IVT00670
50    P(I)=IS                                                           IVT00680
        R(IS)=I                                                         IVT00690
        I=IS                                                            IVT00700
C UPDATE DUAL & DEPTH FOR STEM NODE:                                    IVT00710
        U(I)=U(I)+IDELU                                                 IVT00720
        D(I)=D(I)+IDELD                                                 IVT00730
C ANY DESCNDNTS OF'IS'ON LEFT OF STEM?                                  IVT00740
60      IF(P(I).EQ.LR)GOTO70                                            IVT00750
C YES; UPDATE THEM:                                                     IVT00760
          I=P(I)                                                        IVT00770
          U(I)=U(I)+IDELU                                               IVT00780
          D(I)=D(I)+IDELD                                               IVT00790
        GOTO60                                                          IVT00800
C ANY DESCNDNTS OF'IS', RIGHT OF STEM?                                  IVT00810
70      IF(D(J).LE.ISDPTH)GOTO90                                        IVT00820
C YES; SKIP PREVSLY PROCESSED STEMNODE                                  IVT00830
        P(I)=J                                                          IVT00840
        R(J)=I                                                          IVT00850
C ...AND UPDATE THESE RIGHT-DESCNDNTS:                                  IVT00860
80      I=J                                                             IVT00870
          U(I)=U(I)+IDELU                                               IVT00880
          D(I)=D(I)+IDELD                                               IVT00890
          J=P(J)                                                        IVT00900
        IF(D(J).GT.ISDPTH)GOTO80                                        IVT00910
C ANY MORE STEM NODES?                                                  IVT00920
90      IF(IS.EQ.LNOD)GOTO100                                           IVT00930
C YES; MOVE TO NEXT NODE ON STEM:                                       IVT00940
        LR=IS                                                           IVT00950
        IS=LF                                                           IVT00960
        LF=F(IS)                                                        IVT00970
C UPDATE INFO FOR NEW STEM NODE 'IS':                                   IVT00980
        IDIR2=1                                                         IVT00990
        IF(LF.LT.0)IDIR2=-1                                             IVT01000
        LF=IABS(LF)                                                     IVT01010
        ISDPTH=D(IS)                                                    IVT01020
        IDELD=D(LR)+1-ISDPTH                                            IVT01030
        F(IS)=-IDIR1*LR                                                 IVT01040
        IDIR1=IDIR2                                                     IVT01050
        IFLO2=X(IS)                                                     IVT01060
        X(IS)=IFLO1                                                     IVT01070
        IFLO1=IFLO2                                                     IVT01080
        ID2=ARC(IS)                                                     IVT01090
        ARC(IS)=ID1                                                     IVT01100
        ID1=ID2                                                         IVT01110
      GOTO50                                                            IVT01120
C NO MORE STEM NODES... CONNECT THE                                     IVT01130
C REORDERED SUBTREE TO MAIN SUBTREE:                                    IVT01140
100   IF(IQ.EQ.NRK)GOTO110                                              IVT01150
      P(I)=ISAV                                                         IVT01160
      R(ISAV)=I                                                         IVT01170
      P(IQ)=J                                                           IVT01180
      R(J)=IQ                                                           IVT01190
      RETURN                                                            IVT01200
110   P(I)=J                                                            IVT01210
      R(J)=I                                                            IVT01220
      RETURN                                                            IVT01230
      END                                                               IVT01240
      SUBROUTINE RNREV                                                  REV00010
C                                                                       REV00020
C***** START OF RNET-STANDARD COMMON BLOCK *****************************XXX00030
C** COMMON: M-LONG ARRAYS: P,F,D,U,ARC,X,R; N-LONG: FROM,TO,C,H; PCAND**XXX00040
C** SIZE OF THESE ARRAYS MUST BE DECLARED IN THE USER'S CALLING PRGM. **XXX00050
      INTEGER   FROM,TO,F,D,P,R                                         XXX00060
      INTEGER   C                                                       XXX00070
      INTEGER   BT,PT,PAS,RTN,LPR,H,U,ARC,X,PCAND                       XXX00080
      DIMENSION P(1),F(1),D(1),U(1),ARC(1),X(1),R(1)                    XXX00090
      DIMENSION FROM(1),TO(1),C(1),H(1)                                 XXX00100
      DIMENSION PCAND(1)                                                XXX00110
      DIMENSION RTN(20),LPR(12),RTT(2)                                  XXX00120
      COMMON /A/FROM/B/TO/C/C/D/H/E/P/F/F/G/D/H/U/I/ARC/J/X/K/R/N/PCAND XXX00130
      COMMON /L/BT,MW,PT,M,N,IRT,MXIT,FRQ,P0,PBAR,CP,PAS,RTN,LPR,RTT,   XXX00140
     *          NCAND                                                   XXX00150
      DIMENSION IREVFL(4)                                               XXX00160
      COMMON /M/IREVFL,KARC,ICOM,ITH,MAXF,LNOD,MIC,MAC,NPE,IT,IT0,LGAM, XXX00170
     *          ISDB,TE0                                                XXX00180
C***** END OF RNET-STANDARD COMMON BLOCK *******************************XXX00190
C PROVIDES USER CAPABILITY TO REVISE                                    REV00200
C THE EXOGENOUS FLOWS, COSTS AND CAPA-                                  REV00210
C CITIES AND TO SOLVE THE SO-REVISED                                    REV00220
C PROBLEM BY STARTING FROM THE                                          REV00230
C PREVIOUSLY OBTAINED BASIS.                                            REV00240
C INITIALZE RTN AND TEMPORARY STORAGE:                                  REV00250
        DO 10 I=1,20                                                    REV00260
10      RTN(I)=0                                                        REV00270
        DO 12 I=1,4                                                     REV00280
12      IREVFL(I)=0                                                     REV00290
      RTT(1)=0.0                                                        REV00300
      RTT(2)=0.0                                                        REV00310
      ISDB=0                                                            REV00320
        DO 20 I=1,M                                                     REV00330
20      U(I)=0                                                          REV00340
COMPUTE BASIS*X AND STORE IN U:                                         REV00350
      DO 50 I=1,M                                                       REV00360
        IF(F(I).LT.0)GOTO30                                             REV00370
        ITO=I                                                           REV00380
        IF(F(I).EQ.0)GOTO50                                             REV00390
        IFM=F(I)                                                        REV00400
        GOTO40                                                          REV00410
30      IFM=I                                                           REV00420
        ITO=-F(I)                                                       REV00430
40      U(IFM)=U(IFM)+X(I)                                              REV00440
50    U(ITO)=U(ITO)-X(I)                                                REV00450
      RTN(1)=0                                                          REV00460
      RETURN                                                            REV00470
      END                                                               REV00480
      SUBROUTINE RNRVCJ(J,JDEL)                                         VCJ00010
C                                                                       VCJ00020
C***** START OF RNET-STANDARD COMMON BLOCK *****************************XXX00030
C** COMMON: M-LONG ARRAYS: P,F,D,U,ARC,X,R; N-LONG: FROM,TO,C,H; PCAND**XXX00040
C** SIZE OF THESE ARRAYS MUST BE DECLARED IN THE USER'S CALLING PRGM. **XXX00050
      INTEGER   FROM,TO,F,D,P,R                                         XXX00060
      INTEGER   C                                                       XXX00070
      INTEGER   BT,PT,PAS,RTN,LPR,H,U,ARC,X,PCAND                       XXX00080
      DIMENSION P(1),F(1),D(1),U(1),ARC(1),X(1),R(1)                    XXX00090
      DIMENSION FROM(1),TO(1),C(1),H(1)                                 XXX00100
      DIMENSION PCAND(1)                                                XXX00110
      DIMENSION RTN(20),LPR(12),RTT(2)                                  XXX00120
      COMMON /A/FROM/B/TO/C/C/D/H/E/P/F/F/G/D/H/U/I/ARC/J/X/K/R/N/PCAND XXX00130
      COMMON /L/BT,MW,PT,M,N,IRT,MXIT,FRQ,P0,PBAR,CP,PAS,RTN,LPR,RTT,   XXX00140
     *          NCAND                                                   XXX00150
      DIMENSION IREVFL(4)                                               XXX00160
      COMMON /M/IREVFL,KARC,ICOM,ITH,MAXF,LNOD,MIC,MAC,NPE,IT,IT0,LGAM, XXX00170
     *          ISDB,TE0                                                XXX00180
C***** END OF RNET-STANDARD COMMON BLOCK *******************************XXX00190
C REVISE ONE COST ELEMENT:                                              VCJ00200
      EQUIVALENCE (IREVFL(1),IRFLC)                                     VCJ00210
C                                                                       VCJ00220
      IF(J.LE.0.OR.J.GT.N)GOTO920                                       VCJ00230
      C(J)=C(J)+JDEL                                                    VCJ00240
      IRFLC=1                                                           VCJ00250
      RTN(1)=0                                                          VCJ00260
      RETURN                                                            VCJ00270
920   RTN(1)=230                                                        VCJ00280
      RTN(4)=FROM(J)                                                    VCJ00290
      RTN(5)=TO(J)                                                      VCJ00300
      RTN(2)=J                                                          VCJ00310
      RTN(6)=JDEL                                                       VCJ00320
      RETURN                                                            VCJ00330
      END                                                               VCJ00340
      SUBROUTINE RNRVCV(IL,JDELV)                                       VCV00010
C                                                                       VCV00020
C***** START OF RNET-STANDARD COMMON BLOCK *****************************XXX00030
C** COMMON: M-LONG ARRAYS: P,F,D,U,ARC,X,R; N-LONG: FROM,TO,C,H; PCAND**XXX00040
C** SIZE OF THESE ARRAYS MUST BE DECLARED IN THE USER'S CALLING PRGM. **XXX00050
      INTEGER   FROM,TO,F,D,P,R                                         XXX00060
      INTEGER   C                                                       XXX00070
      INTEGER   BT,PT,PAS,RTN,LPR,H,U,ARC,X,PCAND                       XXX00080
      DIMENSION P(1),F(1),D(1),U(1),ARC(1),X(1),R(1)                    XXX00090
      DIMENSION FROM(1),TO(1),C(1),H(1)                                 XXX00100
      DIMENSION PCAND(1)                                                XXX00110
      DIMENSION RTN(20),LPR(12),RTT(2)                                  XXX00120
      COMMON /A/FROM/B/TO/C/C/D/H/E/P/F/F/G/D/H/U/I/ARC/J/X/K/R/N/PCAND XXX00130
      COMMON /L/BT,MW,PT,M,N,IRT,MXIT,FRQ,P0,PBAR,CP,PAS,RTN,LPR,RTT,   XXX00140
     *          NCAND                                                   XXX00150
      DIMENSION IREVFL(4)                                               XXX00160
      COMMON /M/IREVFL,KARC,ICOM,ITH,MAXF,LNOD,MIC,MAC,NPE,IT,IT0,LGAM, XXX00170
     *          ISDB,TE0                                                XXX00180
C***** END OF RNET-STANDARD COMMON BLOCK *******************************XXX00190
C REVISE ENTIRE COST VECTOR:                                            VCV00200
      EQUIVALENCE (IREVFL(1),IRFLC)                                     VCV00210
      INTEGER JDELV(1)                                                  VCV00220
C                                                                       VCV00230
      IF(IL.NE.N)GOTO910                                                VCV00240
      DO 60 J=1,N                                                       VCV00250
60    C(J)=C(J)+JDELV(J)                                                VCV00260
      RTN(1)=0                                                          VCV00270
      IRFLC=1                                                           VCV00280
      GOTO1000                                                          VCV00290
910   RTN(1)=240                                                        VCV00300
      RTN(2)=IL                                                         VCV00310
1000  RETURN                                                            VCV00320
      END                                                               VCV00330
      SUBROUTINE RNRVBI(J,JDEL)                                         VBI00010
C                                                                       VBI00020
C***** START OF RNET-STANDARD COMMON BLOCK *****************************XXX00030
C** COMMON: M-LONG ARRAYS: P,F,D,U,ARC,X,R; N-LONG: FROM,TO,C,H; PCAND**XXX00040
C** SIZE OF THESE ARRAYS MUST BE DECLARED IN THE USER'S CALLING PRGM. **XXX00050
      INTEGER   FROM,TO,F,D,P,R                                         XXX00060
      INTEGER   C                                                       XXX00070
      INTEGER   BT,PT,PAS,RTN,LPR,H,U,ARC,X,PCAND                       XXX00080
      DIMENSION P(1),F(1),D(1),U(1),ARC(1),X(1),R(1)                    XXX00090
      DIMENSION FROM(1),TO(1),C(1),H(1)                                 XXX00100
      DIMENSION PCAND(1)                                                XXX00110
      DIMENSION RTN(20),LPR(12),RTT(2)                                  XXX00120
      COMMON /A/FROM/B/TO/C/C/D/H/E/P/F/F/G/D/H/U/I/ARC/J/X/K/R/N/PCAND XXX00130
      COMMON /L/BT,MW,PT,M,N,IRT,MXIT,FRQ,P0,PBAR,CP,PAS,RTN,LPR,RTT,   XXX00140
     *          NCAND                                                   XXX00150
      DIMENSION IREVFL(4)                                               XXX00160
      COMMON /M/IREVFL,KARC,ICOM,ITH,MAXF,LNOD,MIC,MAC,NPE,IT,IT0,LGAM, XXX00170
     *          ISDB,TE0                                                XXX00180
C***** END OF RNET-STANDARD COMMON BLOCK *******************************XXX00190
C REVISE ONE EXOGENOUS FLOW VALUE:                                      VBI00200
      EQUIVALENCE (IREVFL(2),IRFLB)                                     VBI00210
C                                                                       VBI00220
      IF(J.LE.0.OR.J.GT.M)GOTO940                                       VBI00230
      ISDB=ISDB+JDEL                                                    VBI00240
      U(J)=U(J)+JDEL                                                    VBI00250
      RTN(1)=0                                                          VBI00260
      IRFLB=1                                                           VBI00270
      GOTO1000                                                          VBI00280
940   RTN(1)=220                                                        VBI00290
      RTN(2)=J                                                          VBI00300
      RTN(6)=JDEL                                                       VBI00310
1000  RETURN                                                            VBI00320
      END                                                               VBI00330
      SUBROUTINE RNRVBV(IL,IDELV)                                       VBV00010
C                                                                       VBV00020
C***** START OF RNET-STANDARD COMMON BLOCK *****************************XXX00030
C** COMMON: M-LONG ARRAYS: P,F,D,U,ARC,X,R; N-LONG: FROM,TO,C,H; PCAND**XXX00040
C** SIZE OF THESE ARRAYS MUST BE DECLARED IN THE USER'S CALLING PRGM. **XXX00050
      INTEGER   FROM,TO,F,D,P,R                                         XXX00060
      INTEGER   C                                                       XXX00070
      INTEGER   BT,PT,PAS,RTN,LPR,H,U,ARC,X,PCAND                       XXX00080
      DIMENSION P(1),F(1),D(1),U(1),ARC(1),X(1),R(1)                    XXX00090
      DIMENSION FROM(1),TO(1),C(1),H(1)                                 XXX00100
      DIMENSION PCAND(1)                                                XXX00110
      DIMENSION RTN(20),LPR(12),RTT(2)                                  XXX00120
      COMMON /A/FROM/B/TO/C/C/D/H/E/P/F/F/G/D/H/U/I/ARC/J/X/K/R/N/PCAND XXX00130
      COMMON /L/BT,MW,PT,M,N,IRT,MXIT,FRQ,P0,PBAR,CP,PAS,RTN,LPR,RTT,   XXX00140
     *          NCAND                                                   XXX00150
      DIMENSION IREVFL(4)                                               XXX00160
      COMMON /M/IREVFL,KARC,ICOM,ITH,MAXF,LNOD,MIC,MAC,NPE,IT,IT0,LGAM, XXX00170
     *          ISDB,TE0                                                XXX00180
C***** END OF RNET-STANDARD COMMON BLOCK *******************************XXX00190
C REVISE ENTIRE EXOG.FLOW VECTOR:                                       VBV00200
      INTEGER IDELV(1)                                                  VBV00210
      EQUIVALENCE (IREVFL(2),IRFLB)                                     VBV00220
C                                                                       VBV00230
      IF(IL.NE.M)GOTO910                                                VBV00240
      DO 70 I=1,M                                                       VBV00250
       IDV=IDELV(I)                                                     VBV00260
       ISDB=ISDB+IDV                                                    VBV00270
70    U(I)=U(I)+IDV                                                     VBV00280
      RTN(1)=0                                                          VBV00290
      IRFLB=1                                                           VBV00300
      GOTO1000                                                          VBV00310
910   RTN(1)=210                                                        VBV00320
      RTN(4)=FROM(J)                                                    VBV00330
      RTN(5)=TO(J)                                                      VBV00340
      RTN(2)=J                                                          VBV00350
      RTN(6)=JDEL                                                       VBV00360
1000  RETURN                                                            VBV00370
      END                                                               VBV00380
      SUBROUTINE RNRVHJ(J,JDEL)                                         VHJ00010
C                                                                       VHJ00020
C***** START OF RNET-STANDARD COMMON BLOCK *****************************XXX00030
C** COMMON: M-LONG ARRAYS: P,F,D,U,ARC,X,R; N-LONG: FROM,TO,C,H; PCAND**XXX00040
C** SIZE OF THESE ARRAYS MUST BE DECLARED IN THE USER'S CALLING PRGM. **XXX00050
      INTEGER   FROM,TO,F,D,P,R                                         XXX00060
      INTEGER   C                                                       XXX00070
      INTEGER   BT,PT,PAS,RTN,LPR,H,U,ARC,X,PCAND                       XXX00080
      DIMENSION P(1),F(1),D(1),U(1),ARC(1),X(1),R(1)                    XXX00090
      DIMENSION FROM(1),TO(1),C(1),H(1)                                 XXX00100
      DIMENSION PCAND(1)                                                XXX00110
      DIMENSION RTN(20),LPR(12),RTT(2)                                  XXX00120
      COMMON /A/FROM/B/TO/C/C/D/H/E/P/F/F/G/D/H/U/I/ARC/J/X/K/R/N/PCAND XXX00130
      COMMON /L/BT,MW,PT,M,N,IRT,MXIT,FRQ,P0,PBAR,CP,PAS,RTN,LPR,RTT,   XXX00140
     *          NCAND                                                   XXX00150
      DIMENSION IREVFL(4)                                               XXX00160
      COMMON /M/IREVFL,KARC,ICOM,ITH,MAXF,LNOD,MIC,MAC,NPE,IT,IT0,LGAM, XXX00170
     *          ISDB,TE0                                                XXX00180
C***** END OF RNET-STANDARD COMMON BLOCK *******************************XXX00190
C REVISE ONE ARC CAPACITY:                                              VHJ00200
      EQUIVALENCE (IREVFL(3),IRFLH)                                     VHJ00210
C                                                                       VHJ00220
      IF(J.LE.0.OR.J.GT.N)GOTO920                                       VHJ00230
      IF(H(J).GT.0)GOTO80                                               VHJ00240
C ARC J IS N.B. AT CAPCTY IN FINL SOL:                                  VHJ00250
      U(FROM(J))=U(FROM(J))-JDEL                                        VHJ00260
      U(TO(J))=U(TO(J))+JDEL                                            VHJ00270
      H(J)=H(J)-JDEL                                                    VHJ00280
      IF(H(J).GE.0)GOTO915                                              VHJ00290
      IRFLH=1                                                           VHJ00300
      GOTO1000                                                          VHJ00310
C ARC J BASIC;OR N.B. AT LOWER BND(0):                                  VHJ00320
80    H(J)=H(J)+JDEL                                                    VHJ00330
      IF(H(J).LE.0)GOTO915                                              VHJ00340
      IRFLH=1                                                           VHJ00350
      GOTO1000                                                          VHJ00360
915   RTN(1)=210                                                        VHJ00370
      GOTO930                                                           VHJ00380
920   RTN(1)=230                                                        VHJ00390
930   RTN(4)=FROM(J)                                                    VHJ00400
      RTN(5)=TO(J)                                                      VHJ00410
      RTN(2)=J                                                          VHJ00420
      RTN(6)=JDEL                                                       VHJ00430
990   RETURN                                                            VHJ00440
1000  RTN(1)=0                                                          VHJ00450
      GOTO990                                                           VHJ00460
      END                                                               VHJ00470
      SUBROUTINE RNRVHV(IL,JDELV)                                       VHV00010
C                                                                       VHV00020
C***** START OF RNET-STANDARD COMMON BLOCK *****************************XXX00030
C** COMMON: M-LONG ARRAYS: P,F,D,U,ARC,X,R; N-LONG: FROM,TO,C,H; PCAND**XXX00040
C** SIZE OF THESE ARRAYS MUST BE DECLARED IN THE USER'S CALLING PRGM. **XXX00050
      INTEGER   FROM,TO,F,D,P,R                                         XXX00060
      INTEGER   C                                                       XXX00070
      INTEGER   BT,PT,PAS,RTN,LPR,H,U,ARC,X,PCAND                       XXX00080
      DIMENSION P(1),F(1),D(1),U(1),ARC(1),X(1),R(1)                    XXX00090
      DIMENSION FROM(1),TO(1),C(1),H(1)                                 XXX00100
      DIMENSION PCAND(1)                                                XXX00110
      DIMENSION RTN(20),LPR(12),RTT(2)                                  XXX00120
      COMMON /A/FROM/B/TO/C/C/D/H/E/P/F/F/G/D/H/U/I/ARC/J/X/K/R/N/PCAND XXX00130
      COMMON /L/BT,MW,PT,M,N,IRT,MXIT,FRQ,P0,PBAR,CP,PAS,RTN,LPR,RTT,   XXX00140
     *          NCAND                                                   XXX00150
      DIMENSION IREVFL(4)                                               XXX00160
      COMMON /M/IREVFL,KARC,ICOM,ITH,MAXF,LNOD,MIC,MAC,NPE,IT,IT0,LGAM, XXX00170
     *          ISDB,TE0                                                XXX00180
C***** END OF RNET-STANDARD COMMON BLOCK *******************************XXX00190
C REVISE ENTIRE CAPACITY VECTOR:                                        VHV00200
      INTEGER JDELV(1)                                                  VHV00210
      EQUIVALENCE (IREVFL(3),IRFLH)                                     VHV00220
C                                                                       VHV00230
      IF(IL.NE.N)GOTO910                                                VHV00240
      DO 100 K=1,N                                                      VHV00250
       JV=JDELV(K)                                                      VHV00260
       IF(H(K).GT.0)GOTO90                                              VHV00270
C ARC K IS N.B. AT CAPCTY IN FINL SOL:                                  VHV00280
       U(FROM(K))=U(FROM(K))-JV                                         VHV00290
       U(TO(K))=U(TO(K))+JV                                             VHV00300
       H(K)=H(K)-JV                                                     VHV00310
       IF(H(K).GE.0)GOTO900                                             VHV00320
       GOTO100                                                          VHV00330
C ARC K BASIC;OR N.B. AT LOWER BND(0):                                  VHV00340
90     H(K)=H(K)+JV                                                     VHV00350
       IF(H(K).LE.0)GOTO900                                             VHV00360
100   CONTINUE                                                          VHV00370
      IRFLH=1                                                           VHV00380
      GOTO1000                                                          VHV00390
900   RTN(1)=210                                                        VHV00400
      GOTO930                                                           VHV00410
910   RTN(1)=240                                                        VHV00420
      RTN(2)=IL                                                         VHV00430
      GOTO990                                                           VHV00440
930   RTN(4)=FROM(K)                                                    VHV00450
      RTN(5)=TO(K)                                                      VHV00460
      RTN(2)=K                                                          VHV00470
      RTN(6)=JV                                                         VHV00480
990   RETURN                                                            VHV00490
1000  RTN(1)=0                                                          VHV00500
      GOTO990                                                           VHV00510
      END                                                               VHV00520
      SUBROUTINE RNREST                                                 EST00010
C                                                                       EST00020
C***** START OF RNET-STANDARD COMMON BLOCK *****************************XXX00030
C** COMMON: M-LONG ARRAYS: P,F,D,U,ARC,X,R; N-LONG: FROM,TO,C,H; PCAND**XXX00040
C** SIZE OF THESE ARRAYS MUST BE DECLARED IN THE USER'S CALLING PRGM. **XXX00050
      INTEGER   FROM,TO,F,D,P,R                                         XXX00060
      INTEGER   C                                                       XXX00070
      INTEGER   BT,PT,PAS,RTN,LPR,H,U,ARC,X,PCAND                       XXX00080
      DIMENSION P(1),F(1),D(1),U(1),ARC(1),X(1),R(1)                    XXX00090
      DIMENSION FROM(1),TO(1),C(1),H(1)                                 XXX00100
      DIMENSION PCAND(1)                                                XXX00110
      DIMENSION RTN(20),LPR(12),RTT(2)                                  XXX00120
      COMMON /A/FROM/B/TO/C/C/D/H/E/P/F/F/G/D/H/U/I/ARC/J/X/K/R/N/PCAND XXX00130
      COMMON /L/BT,MW,PT,M,N,IRT,MXIT,FRQ,P0,PBAR,CP,PAS,RTN,LPR,RTT,   XXX00140
     *          NCAND                                                   XXX00150
      DIMENSION IREVFL(4)                                               XXX00160
      COMMON /M/IREVFL,KARC,ICOM,ITH,MAXF,LNOD,MIC,MAC,NPE,IT,IT0,LGAM, XXX00170
     *          ISDB,TE0                                                XXX00180
C***** END OF RNET-STANDARD COMMON BLOCK *******************************XXX00190
C ASSUMES ALL DATA REVISED PREVIOUSLY,                                  EST00200
C AND THAT NET RHS IS IN 'U'.                                           EST00210
C REVISE FLOWS, BASIS & RESTART RNET                                    EST00220
      PAS=0                                                             EST00230
      MW=(2**(BT-2)-1)*2+1                                              EST00240
      IF(NCAND.EQ.0)GOTO11                                              EST00250
      IF(NCAND.LT.0.OR.NCAND.GT.N)GOTO945                               EST00260
      IT=FRQ*NCAND*0.01+0.5                                             EST00270
      IT=MAX0(1,IT)                                                     EST00280
11    IF(ISDB.EQ.0)GOTO110                                              EST00290
      RTN(1)=200                                                        EST00300
      RTN(2)=ISDB                                                       EST00310
      GOTO990                                                           EST00320
C (BASIS INVERSE)*(REVISED NET RHS):                                    EST00330
110   CALL RNTIME(TE0)                                                  EST00340
        DO 120 I=1,M                                                    EST00350
120     X(I)=0                                                          EST00360
      MAC=-MW                                                           EST00370
      MAH=-MW                                                           EST00380
      MIC=MW                                                            EST00390
      MIH=MW                                                            EST00400
      DO 130 K=1,N                                                      EST00410
CHECK OPTIONAL PRICING CAND LIST:                                       EST00420
        IF(NCAND.EQ.0)GOTO125                                           EST00430
        IF(K.GT.NCAND)GOTO125                                           EST00440
        IF(PCAND(K).LE.0)GOTO946                                        EST00450
        IF(PCAND(K).GT.N)GOTO946                                        EST00460
125     ICJ=C(K)                                                        EST00470
        IHJ=IABS(H(K))                                                  EST00480
        IF(ICJ.GT.MAC)MAC=ICJ                                           EST00490
        IF(IHJ.GT.MAH)MAH=IHJ                                           EST00500
        IF(ICJ.LT.MIC)MIC=ICJ                                           EST00510
        IF(IHJ.LT.MIH)MIH=IHJ                                           EST00520
130   CONTINUE                                                          EST00530
      RTN(13)=MIC                                                       EST00540
      RTN(14)=MAC                                                       EST00550
      RTN(15)=MIH                                                       EST00560
      RTN(16)=MAH                                                       EST00570
      IF(IREVFL(2)+IREVFL(3).EQ.0)GOTO220                               EST00580
      I=R(IRT)                                                          EST00590
140   IREG=X(I)+U(I)                                                    EST00600
        IP=F(I)                                                         EST00610
        IF(IP)150,180,160                                               EST00620
150     X(I)=IREG                                                       EST00630
        IP=-IP                                                          EST00640
        GOTO170                                                         EST00650
160     X(I)=-IREG                                                      EST00660
170     X(IP)=X(IP)+IREG                                                EST00670
        I=R(I)                                                          EST00680
      GOTO140                                                           EST00690
180   X(I)=-IREG                                                        EST00700
C REVISED FLOWS & NEW INITL BASIS:                                      EST00710
      DO 210 I=1,M                                                      EST00720
C FIRST CHECK THE ARC FLOWS:                                            EST00730
        IF(X(I).EQ.0)GOTO210                                            EST00740
        IF(X(I).GT.0)GOTO190                                            EST00750
C ARC WITH NEGATIVE FLOW:                                               EST00760
        X(I)=-X(I)                                                      EST00770
        F(I)=-F(I)                                                      EST00780
        GOTO200                                                         EST00790
C ARC WITH POSITIVE FLOW:                                               EST00800
190     IF(ARC(I).EQ.0)GOTO210                                          EST00810
        IF(H(ARC(I)).LT.0)GOTO210                                       EST00820
        IF(X(I).LE.H(ARC(I)))GOTO210                                    EST00830
C ARC W/ POS FLOW EXCEEDS CAPACITY:                                     EST00840
        X(I)=X(I)-H(ARC(I))                                             EST00850
        H(ARC(I))=-H(ARC(I))                                            EST00860
CREATE ARTIFICIAL ARC:                                                  EST00870
200     ARC(I)=0                                                        EST00880
        IF(F(I).NE.0)GOTO210                                            EST00890
        RTN(1)=800                                                      EST00900
        GOTO990                                                         EST00910
210   CONTINUE                                                          EST00920
C RECOMPUTE DUALS:                                                      EST00930
220   CALL RNPENY(CPN,NPN,NPAS,NNRTN)                                   EST00940
      IF(NNRTN.NE.1)GOTO960                                             EST00950
      CP=CPN                                                            EST00960
      NPE=NPN                                                           EST00970
      PAS=NPAS                                                          EST00980
      CALL RNDUL1                                                       EST00990
C BACK TO SIMPLEX METHOD:                                               EST01000
      CALL RNCNT0                                                       EST01010
C EXITS:                                                                EST01020
990   RETURN                                                            EST01030
945   RTN(1)=320                                                        EST01040
      RTN(2)=NCAND                                                      EST01050
      GOTO990                                                           EST01060
946   RTN(1)=330                                                        EST01070
      RTN(2)=NCAND                                                      EST01080
      RTN(3)=K                                                          EST01090
      RTN(4)=PCAND(K)                                                   EST01100
      GOTO990                                                           EST01110
960   RTN(1)=160                                                        EST01120
      RTN(2)=MIC                                                        EST01130
      RTN(3)=MAC                                                        EST01140
      GOTO990                                                           EST01150
      END                                                               EST01160
      SUBROUTINE RNOBJI                                                 BJI00010
C                                                                       BJI00020
C***** START OF RNET-STANDARD COMMON BLOCK *****************************XXX00030
C** COMMON: M-LONG ARRAYS: P,F,D,U,ARC,X,R; N-LONG: FROM,TO,C,H; PCAND**XXX00040
C** SIZE OF THESE ARRAYS MUST BE DECLARED IN THE USER'S CALLING PRGM. **XXX00050
      INTEGER   FROM,TO,F,D,P,R                                         XXX00060
      INTEGER   C                                                       XXX00070
      INTEGER   BT,PT,PAS,RTN,LPR,H,U,ARC,X,PCAND                       XXX00080
      DIMENSION P(1),F(1),D(1),U(1),ARC(1),X(1),R(1)                    XXX00090
      DIMENSION FROM(1),TO(1),C(1),H(1)                                 XXX00100
      DIMENSION PCAND(1)                                                XXX00110
      DIMENSION RTN(20),LPR(12),RTT(2)                                  XXX00120
      COMMON /A/FROM/B/TO/C/C/D/H/E/P/F/F/G/D/H/U/I/ARC/J/X/K/R/N/PCAND XXX00130
      COMMON /L/BT,MW,PT,M,N,IRT,MXIT,FRQ,P0,PBAR,CP,PAS,RTN,LPR,RTT,   XXX00140
     *          NCAND                                                   XXX00150
      DIMENSION IREVFL(4)                                               XXX00160
      COMMON /M/IREVFL,KARC,ICOM,ITH,MAXF,LNOD,MIC,MAC,NPE,IT,IT0,LGAM, XXX00170
     *          ISDB,TE0                                                XXX00180
C***** END OF RNET-STANDARD COMMON BLOCK *******************************XXX00190
C RNET USER-SERVICE AND INTERNAL ROUTINE:                               BJI00200
C EXACT INTEGER COMPUTATION OF OBJECTVE                                 BJI00210
C FUNCTION VALUE 'Z', IN MODULO MW,                                     BJI00220
C ( ZM=(Z MOD MW); BAS=INT(Z/MW)  ).                                    BJI00230
COUNTS NO.OF SATURATED & +VE ARTFLS.                                    BJI00240
C (SLOWER THAN SUBROUTINE 'RNOBJR(ZR)').                                BJI00250
      INTEGER P2(100),NM(2),NM1(2)                                      BJI00260
      INTEGER NP(2),IZA(2),BAS,ZM                                       BJI00270
C SET UP LIST OF POWERS OF 2:                                           BJI00280
      IB1=BT-1                                                          BJI00290
      P2(1)=1                                                           BJI00300
      DO 10 I=2,IB1                                                     BJI00310
10    P2(I)=P2(I-1)*2                                                   BJI00320
      RMW=MW                                                            BJI00330
      MWSR=SQRT(RMW)                                                    BJI00340
      BAS=0                                                             BJI00350
      ZM=0                                                              BJI00360
      NPART=0                                                           BJI00370
      NSAT=0                                                            BJI00380
      IEXTNT=M                                                          BJI00390
      DO 170 II=1,2                                                     BJI00400
C II=1: BASICS, II=2: NONBASICS.                                        BJI00410
       DO 160 I=1,IEXTNT                                                BJI00420
        IF(II.EQ.1)GOTO20                                               BJI00430
        IARC=I                                                          BJI00440
        IF(H(IARC).GE.0)GOTO160                                         BJI00450
C NONBASIC SATURATED ARC:                                               BJI00460
        IX=IABS(H(IARC))                                                BJI00470
        NSAT=NSAT+1                                                     BJI00480
        GOTO40                                                          BJI00490
20      IF(X(I).EQ.0)GOTO160                                            BJI00500
C BASIC ARC AT POSITIVE FLOW:                                           BJI00510
        IARC=ARC(I)                                                     BJI00520
        IF(IARC.NE.0)GOTO30                                             BJI00530
C BASIC ARTFL AT +VE FLOW (DISREGARD):                                  BJI00540
        NPART=NPART+1                                                   BJI00550
        GOTO160                                                         BJI00560
30      IX=X(I)                                                         BJI00570
COUNT BASIC SATURATED ARCS:                                             BJI00580
        IF(IX.EQ.H(IARC))NSAT=NSAT+1                                    BJI00590
C EXACT INTEGER MULTIPLICATION :                                        BJI00600
C MULTIPLY COST*FLOW W/O OVERFLOW:                                      BJI00610
40      IC=C(IARC)                                                      BJI00620
        IF(IC.EQ.0)GOTO160                                              BJI00630
        ICS=ISIGN(1,IC)                                                 BJI00640
        ICA=IABS(IC)                                                    BJI00650
50      KSAVE=1                                                         BJI00660
C MUST OBTAIN ICS*NM(1)*NM(2)                                           BJI00670
        NM(1)=MAX0(IX,ICA)                                              BJI00680
         NM(2)=MIN0(IX,ICA)                                             BJI00690
C CHECK FOR GUARANTEED NO OVERFLOW:                                     BJI00700
C                                                                       BJI00710
         IF(NM(1).LT.MWSR)GOTO75                                        BJI00720
         IF(NM(2).LE.1)GOTO75                                           BJI00730
C EXPAND NM(1),NM(2) TO BASE 2 POLYNL                                   BJI00740
         J=1                                                            BJI00750
60       KSAV=KSAVE                                                     BJI00760
C GET NP(1),NP(2), HIGHEST POWER TERMS:                                 BJI00770
         DO 65 K=KSAV,IB1                                               BJI00780
          KK=BT-K                                                       BJI00790
          IF(NM(J).LT.P2(KK))GOTO65                                     BJI00800
          NP(J)=KK-1                                                    BJI00810
          IF(J.EQ.2)GOTO70                                              BJI00820
          KSAVE=K                                                       BJI00830
          J=2                                                           BJI00840
      GOTO60                                                            BJI00850
65       CONTINUE                                                       BJI00860
C IEX=HIGHEST 2-PWR OF PRODCT,OVER BT1                                  BJI00870
70       IEX=NP(1)+NP(2)-IB1                                            BJI00880
         IOK=0                                                          BJI00890
         IF(IEX.GE.0)GOTO80                                             BJI00900
         IF(IEX.LT.-1)GOTO75                                            BJI00910
         IZT=P2(IB1)                                                    BJI00920
         IOK=4                                                          BJI00930
         GOTO100                                                        BJI00940
C GUARANTEED NO OVERFLOW; MULTIPLY:                                     BJI00950
75       IZT=NM(1)*NM(2)                                                BJI00960
         IOK=2                                                          BJI00970
         GOTO100                                                        BJI00980
C OVERFLOW WILL ENSUE. USE POLYNOM'L                                    BJI00990
80       BAS=BAS+ICS*P2(IEX+1)                                          BJI01000
90       IP1=P2(NP(1)+1)                                                BJI01010
         IP2=P2(NP(2)+1)                                                BJI01020
         NM1(1)=NM(1)-IP1                                               BJI01030
         NM1(2)=NM(2)-IP2                                               BJI01040
         IPP2=P2(BT-NP(1))                                              BJI01050
         IPP1=P2(BT-NP(2))                                              BJI01060
         NCF=NM1(2)/IPP2                                                BJI01070
         BAS=BAS+NCF*ICS                                                BJI01080
         IZA(1)=IP1*(NM1(2)-NCF*IPP2)                                   BJI01090
         NCF=NM1(1)/IPP1                                                BJI01100
         BAS=BAS+NCF*ICS                                                BJI01110
         IZA(2)=IP2*(NM1(1)-NCF*IPP1)                                   BJI01120
         IZT=IZA(1)                                                     BJI01130
C ADD 'IZT' TO SUM, BUT W/O OVERFLOW:                                   BJI01140
100      IS=0                                                           BJI01150
          IZT=ICS*IZT                                                   BJI01160
          IF(IC.LT.0.AND.ZM.LT.0)IS=-1                                  BJI01170
          IF(IC.GT.0.AND.ZM.GT.0)IS=1                                   BJI01180
          IF(IS)110,140,120                                             BJI01190
110       IF(MW+ZM.GE.-IZT)GOTO140                                      BJI01200
          GOTO130                                                       BJI01210
120       IF(MW-ZM.GE.IZT)GOTO140                                       BJI01220
130       BAS=BAS+IS                                                    BJI01230
          ZM=ZM-IS*MW-IS                                                BJI01240
140       ZM=ZM+IZT                                                     BJI01250
C                                                                       BJI01260
          IF(IOK.EQ.2)GOTO160                                           BJI01270
          IF(IOK.NE.4)GOTO145                                           BJI01280
          IOK=0                                                         BJI01290
          GOTO90                                                        BJI01300
145       IOK=IOK+1                                                     BJI01310
          IF(IOK.EQ.2)GOTO150                                           BJI01320
          IZT=IZA(2)                                                    BJI01330
         GOTO100                                                        BJI01340
CONTINUE W/ REST OF THE POLYNML PRODCT                                  BJI01350
150      ICA=NM1(1)                                                     BJI01360
         IX=NM1(2)                                                      BJI01370
        GOTO50                                                          BJI01380
160    CONTINUE                                                         BJI01390
170   IEXTNT=N                                                          BJI01400
C IF APPROXIMATE MULTIPL'N, WE'RE DONE:                                 BJI01410
C ALL ABOVE WAS DONE FOR MOD MW+1                                       BJI01420
C NOW, BRING IT BACK TO MOD MW:                                         BJI01430
      IF(BAS.GE.0.AND.ZM.GE.0)GOTO175                                   BJI01440
      IF(BAS.LE.0.AND.ZM.LE.0)GOTO180                                   BJI01450
      GOTO185                                                           BJI01460
175   IF(MW-BAS.GT.ZM)GOTO185                                           BJI01470
      ZM=ZM-MW+BAS                                                      BJI01480
      BAS=BAS+1                                                         BJI01490
      GOTO190                                                           BJI01500
180   IF(-MW-BAS.LT.ZM)GOTO185                                          BJI01510
      ZM=ZM+MW+BAS                                                      BJI01520
      BAS=BAS-1                                                         BJI01530
      GOTO190                                                           BJI01540
185   ZM=ZM+BAS                                                         BJI01550
190   RTN(2)=ZM                                                         BJI01560
      RTN(3)=BAS                                                        BJI01570
200   RTN(10)=NSAT                                                      BJI01580
      RTN(11)=NPART                                                     BJI01590
      RETURN                                                            BJI01600
      END                                                               BJI01610
      SUBROUTINE RNOBJR(ZR)                                             BJR00010
C                                                                       BJR00020
C***** START OF RNET-STANDARD COMMON BLOCK *****************************XXX00030
C** COMMON: M-LONG ARRAYS: P,F,D,U,ARC,X,R; N-LONG: FROM,TO,C,H; PCAND**XXX00040
C** SIZE OF THESE ARRAYS MUST BE DECLARED IN THE USER'S CALLING PRGM. **XXX00050
      INTEGER   FROM,TO,F,D,P,R                                         XXX00060
      INTEGER   C                                                       XXX00070
      INTEGER   BT,PT,PAS,RTN,LPR,H,U,ARC,X,PCAND                       XXX00080
      DIMENSION P(1),F(1),D(1),U(1),ARC(1),X(1),R(1)                    XXX00090
      DIMENSION FROM(1),TO(1),C(1),H(1)                                 XXX00100
      DIMENSION PCAND(1)                                                XXX00110
      DIMENSION RTN(20),LPR(12),RTT(2)                                  XXX00120
      COMMON /A/FROM/B/TO/C/C/D/H/E/P/F/F/G/D/H/U/I/ARC/J/X/K/R/N/PCAND XXX00130
      COMMON /L/BT,MW,PT,M,N,IRT,MXIT,FRQ,P0,PBAR,CP,PAS,RTN,LPR,RTT,   XXX00140
     *          NCAND                                                   XXX00150
      DIMENSION IREVFL(4)                                               XXX00160
      COMMON /M/IREVFL,KARC,ICOM,ITH,MAXF,LNOD,MIC,MAC,NPE,IT,IT0,LGAM, XXX00170
     *          ISDB,TE0                                                XXX00180
C***** END OF RNET-STANDARD COMMON BLOCK *******************************XXX00190
C RNET USER-SERVICE ROUTINE: APPROXIMATE                                BJR00200
C OBJECTIVE FUNCTION COMPUTATION IN REAL                                BJR00210
C VARIABLE 'ZR'. COUNTS THE NO. OF SAT'D                                BJR00220
C & +VE ARTIFICIALS. THIS SUBROUTINE IS                                 BJR00230
C FASTER THAN SUBR. 'RNOBJI'.                                           BJR00240
      DOUBLE PRECISION ZRD,CID                                          BJR00250
      ZRD=0.0D00                                                        BJR00260
      RTN(2)=0                                                          BJR00270
      RTN(3)=0                                                          BJR00280
      NPART=0                                                           BJR00290
      NSAT=0                                                            BJR00300
      IEXTNT=M                                                          BJR00310
      DO 170 II=1,2                                                     BJR00320
C II=1: BASICS, II=2: NONBASICS.                                        BJR00330
       DO 160 I=1,IEXTNT                                                BJR00340
        IF(II.EQ.1)GOTO20                                               BJR00350
        IARC=I                                                          BJR00360
        IF(H(IARC).GE.0)GOTO160                                         BJR00370
C NONBASIC SATURATED ARC:                                               BJR00380
        IX=IABS(H(IARC))                                                BJR00390
        NSAT=NSAT+1                                                     BJR00400
        GOTO40                                                          BJR00410
20      IF(X(I).EQ.0)GOTO160                                            BJR00420
C BASIC ARC AT POSITIVE FLOW:                                           BJR00430
        IARC=ARC(I)                                                     BJR00440
        IF(IARC.NE.0)GOTO30                                             BJR00450
C BASIC ARTFL AT +VE FLOW (DISREGARD):                                  BJR00460
        NPART=NPART+1                                                   BJR00470
        GOTO160                                                         BJR00480
30      IX=X(I)                                                         BJR00490
COUNT BASIC SATURATED ARCS:                                             BJR00500
        IF(IX.EQ.H(IARC))NSAT=NSAT+1                                    BJR00510
C APPROXIMATE MULTIPLICATION (REAL VAR)                                 BJR00520
40      CID=C(IARC)                                                     BJR00530
        ZRD=ZRD+CID*IX                                                  BJR00540
160    CONTINUE                                                         BJR00550
170   IEXTNT=N                                                          BJR00560
      ZR=ZRD                                                            BJR00570
      RTN(10)=NSAT                                                      BJR00580
      RTN(11)=NPART                                                     BJR00590
      RETURN                                                            BJR00600
      END                                                               BJR00610
      SUBROUTINE RNBPRL(IL)                                             PRL00010
C                                                                       PRL00020
C***** START OF RNET-STANDARD COMMON BLOCK *****************************XXX00030
C** COMMON: M-LONG ARRAYS: P,F,D,U,ARC,X,R; N-LONG: FROM,TO,C,H; PCAND**XXX00040
C** SIZE OF THESE ARRAYS MUST BE DECLARED IN THE USER'S CALLING PRGM. **XXX00050
      INTEGER   FROM,TO,F,D,P,R                                         XXX00060
      INTEGER   C                                                       XXX00070
      INTEGER   BT,PT,PAS,RTN,LPR,H,U,ARC,X,PCAND                       XXX00080
      DIMENSION P(1),F(1),D(1),U(1),ARC(1),X(1),R(1)                    XXX00090
      DIMENSION FROM(1),TO(1),C(1),H(1)                                 XXX00100
      DIMENSION PCAND(1)                                                XXX00110
      DIMENSION RTN(20),LPR(12),RTT(2)                                  XXX00120
      COMMON /A/FROM/B/TO/C/C/D/H/E/P/F/F/G/D/H/U/I/ARC/J/X/K/R/N/PCAND XXX00130
      COMMON /L/BT,MW,PT,M,N,IRT,MXIT,FRQ,P0,PBAR,CP,PAS,RTN,LPR,RTT,   XXX00140
     *          NCAND                                                   XXX00150
      DIMENSION IREVFL(4)                                               XXX00160
      COMMON /M/IREVFL,KARC,ICOM,ITH,MAXF,LNOD,MIC,MAC,NPE,IT,IT0,LGAM, XXX00170
     *          ISDB,TE0                                                XXX00180
C***** END OF RNET-STANDARD COMMON BLOCK *******************************XXX00190
C RNET USER-SERVICE ROUTINE:                                            PRL00200
C PREPARES PRINT LINE FOR NODE 'IL'.                                    PRL00210
      IF(IL.LE.0.OR.IL.GT.M)GOTO900                                     PRL00220
      J=ARC(IL)                                                         PRL00230
      LPR(1)=IL                                                         PRL00240
      LPR(2)=J                                                          PRL00250
      LPR(3)=F(IL)                                                      PRL00260
      LPR(4)=IL                                                         PRL00270
      IF(LPR(3).GE.0)GOTO30                                             PRL00280
      LPR(4)=-F(IL)                                                     PRL00290
      LPR(3)=IL                                                         PRL00300
30    LPR(5)=1                                                          PRL00310
      LPR(6)=P(IL)                                                      PRL00320
      LPR(7)=D(IL)                                                      PRL00330
      LPR(8)=U(IL)                                                      PRL00340
      LPR(9)=X(IL)                                                      PRL00350
      LPR(10)=MW                                                        PRL00360
      LPR(11)=0                                                         PRL00370
      IF(J.EQ.0)GOTO50                                                  PRL00380
40    LPR(10)=IABS(H(J))                                                PRL00390
      LPR(11)=C(J)                                                      PRL00400
50    LPR(12)=LPR(9)*LPR(11)                                            PRL00410
990   RETURN                                                            PRL00420
900   RTN(1)=300                                                        PRL00430
      RTN(2)=IL                                                         PRL00440
      GOTO990                                                           PRL00450
      END                                                               PRL00460
      SUBROUTINE RNAPRL(IL)                                             PRL00010
C                                                                       PRL00020
C***** START OF RNET-STANDARD COMMON BLOCK *****************************XXX00030
C** COMMON: M-LONG ARRAYS: P,F,D,U,ARC,X,R; N-LONG: FROM,TO,C,H; PCAND**XXX00040
C** SIZE OF THESE ARRAYS MUST BE DECLARED IN THE USER'S CALLING PRGM. **XXX00050
      INTEGER   FROM,TO,F,D,P,R                                         XXX00060
      INTEGER   C                                                       XXX00070
      INTEGER   BT,PT,PAS,RTN,LPR,H,U,ARC,X,PCAND                       XXX00080
      DIMENSION P(1),F(1),D(1),U(1),ARC(1),X(1),R(1)                    XXX00090
      DIMENSION FROM(1),TO(1),C(1),H(1)                                 XXX00100
      DIMENSION PCAND(1)                                                XXX00110
      DIMENSION RTN(20),LPR(12),RTT(2)                                  XXX00120
      COMMON /A/FROM/B/TO/C/C/D/H/E/P/F/F/G/D/H/U/I/ARC/J/X/K/R/N/PCAND XXX00130
      COMMON /L/BT,MW,PT,M,N,IRT,MXIT,FRQ,P0,PBAR,CP,PAS,RTN,LPR,RTT,   XXX00140
     *          NCAND                                                   XXX00150
      DIMENSION IREVFL(4)                                               XXX00160
      COMMON /M/IREVFL,KARC,ICOM,ITH,MAXF,LNOD,MIC,MAC,NPE,IT,IT0,LGAM, XXX00170
     *          ISDB,TE0                                                XXX00180
C***** END OF RNET-STANDARD COMMON BLOCK *******************************XXX00190
C RNET USER-SERVICE ROUTINE:                                            PRL00200
C PREPARES PRINT LINE FOR ARC 'IL'.                                     PRL00210
      IF(IL.LE.0.OR.IL.GT.N)GOTO900                                     PRL00220
      DO 55 I=1,9                                                       PRL00230
55    LPR(I)=0                                                          PRL00240
      LPR(2)=IL                                                         PRL00250
      LPR(3)=FROM(IL)                                                   PRL00260
      LPR(4)=TO(IL)                                                     PRL00270
      LPR(8)=C(IL)-U(FROM(IL))+U(TO(IL))                                PRL00280
      LPR(11)=C(IL)                                                     PRL00290
      LPR(10)=IABS(H(IL))                                               PRL00300
      IF(ARC(LPR(3)).EQ.IL)GOTO56                                       PRL00310
      IF(ARC(LPR(4)).EQ.IL)GOTO561                                      PRL00320
      GOTO58                                                            PRL00330
56    LPR(1)=LPR(3)                                                     PRL00340
      GOTO563                                                           PRL00350
561   LPR(1)=LPR(4)                                                     PRL00360
563   LPR(5)=1                                                          PRL00370
      LPR(6)=P(LPR(1))                                                  PRL00380
      LPR(7)=D(LPR(1))                                                  PRL00390
      LPR(8)=U(LPR(1))                                                  PRL00400
      LPR(9)=X(LPR(1))                                                  PRL00410
      GOTO59                                                            PRL00420
58    IF(H(IL).LT.0)LPR(9)=LPR(10)                                      PRL00430
59    LPR(12)=LPR(9)*LPR(11)                                            PRL00440
990   RETURN                                                            PRL00450
900   RTN(1)=300                                                        PRL00460
      RTN(2)=IL                                                         PRL00470
      GOTO990                                                           PRL00480
      END                                                               PRL00490
      SUBROUTINE RNBTNI(IL,VI,VO)                                       TNI00010
C                                                                       TNI00020
C***** START OF RNET-STANDARD COMMON BLOCK *****************************XXX00030
C** COMMON: M-LONG ARRAYS: P,F,D,U,ARC,X,R; N-LONG: FROM,TO,C,H; PCAND**XXX00040
C** SIZE OF THESE ARRAYS MUST BE DECLARED IN THE USER'S CALLING PRGM. **XXX00050
      INTEGER   FROM,TO,F,D,P,R                                         XXX00060
      INTEGER   C                                                       XXX00070
      INTEGER   BT,PT,PAS,RTN,LPR,H,U,ARC,X,PCAND                       XXX00080
      DIMENSION P(1),F(1),D(1),U(1),ARC(1),X(1),R(1)                    XXX00090
      DIMENSION FROM(1),TO(1),C(1),H(1)                                 XXX00100
      DIMENSION PCAND(1)                                                XXX00110
      DIMENSION RTN(20),LPR(12),RTT(2)                                  XXX00120
      COMMON /A/FROM/B/TO/C/C/D/H/E/P/F/F/G/D/H/U/I/ARC/J/X/K/R/N/PCAND XXX00130
      COMMON /L/BT,MW,PT,M,N,IRT,MXIT,FRQ,P0,PBAR,CP,PAS,RTN,LPR,RTT,   XXX00140
     *          NCAND                                                   XXX00150
      DIMENSION IREVFL(4)                                               XXX00160
      COMMON /M/IREVFL,KARC,ICOM,ITH,MAXF,LNOD,MIC,MAC,NPE,IT,IT0,LGAM, XXX00170
     *          ISDB,TE0                                                XXX00180
C***** END OF RNET-STANDARD COMMON BLOCK *******************************XXX00190
C RNET USER-SERVICE ROUTINE:                                            TNI00200
C (VCTR OUT)=(VCTR IN)*(BASIS INVRSE):                                  TNI00210
C VI AND VO MUST BE M-LONG:                                             TNI00220
      INTEGER VI(1),VO(1)                                               TNI00230
      IF(IL.NE.M)GOTO900                                                TNI00240
      VO(IRT)=-VI(IRT)                                                  TNI00250
      I=P(IRT)                                                          TNI00260
60    IF(F(I).EQ.0)GOTO1000                                             TNI00270
       IP=F(I)                                                          TNI00280
       IVI=VI(I)                                                        TNI00290
       IF(IP.GE.0)IVI=-IVI                                              TNI00300
       VO(I)=IVI+VO(IABS(IP))                                           TNI00310
       I=P(I)                                                           TNI00320
      GOTO60                                                            TNI00330
900   RTN(1)=300                                                        TNI00340
      RTN(2)=IL                                                         TNI00350
990   RETURN                                                            TNI00360
1000  RTN(1)=0                                                          TNI00370
      GOTO990                                                           TNI00380
      END                                                               TNI00390
      SUBROUTINE RNBTNR(IL,RVI,RVO)                                     TNR00010
C                                                                       TNR00020
C***** START OF RNET-STANDARD COMMON BLOCK *****************************XXX00030
C** COMMON: M-LONG ARRAYS: P,F,D,U,ARC,X,R; N-LONG: FROM,TO,C,H; PCAND**XXX00040
C** SIZE OF THESE ARRAYS MUST BE DECLARED IN THE USER'S CALLING PRGM. **XXX00050
      INTEGER   FROM,TO,F,D,P,R                                         XXX00060
      INTEGER   C                                                       XXX00070
      INTEGER   BT,PT,PAS,RTN,LPR,H,U,ARC,X,PCAND                       XXX00080
      DIMENSION P(1),F(1),D(1),U(1),ARC(1),X(1),R(1)                    XXX00090
      DIMENSION FROM(1),TO(1),C(1),H(1)                                 XXX00100
      DIMENSION PCAND(1)                                                XXX00110
      DIMENSION RTN(20),LPR(12),RTT(2)                                  XXX00120
      COMMON /A/FROM/B/TO/C/C/D/H/E/P/F/F/G/D/H/U/I/ARC/J/X/K/R/N/PCAND XXX00130
      COMMON /L/BT,MW,PT,M,N,IRT,MXIT,FRQ,P0,PBAR,CP,PAS,RTN,LPR,RTT,   XXX00140
     *          NCAND                                                   XXX00150
      DIMENSION IREVFL(4)                                               XXX00160
      COMMON /M/IREVFL,KARC,ICOM,ITH,MAXF,LNOD,MIC,MAC,NPE,IT,IT0,LGAM, XXX00170
     *          ISDB,TE0                                                XXX00180
C***** END OF RNET-STANDARD COMMON BLOCK *******************************XXX00190
C RNET USER-SERVICE ROUTINE:                                            TNR00200
C SAME AS RNBTNI BUT FOR REAL VI,VO.                                    TNR00210
      REAL    RVI(1),RVO(1)                                             TNR00220
      IF(IL.NE.M)GOTO900                                                TNR00230
      RVO(IRT)=-RVI(IRT)                                                TNR00240
      I=P(IRT)                                                          TNR00250
65    IF(F(I).EQ.0)GOTO1000                                             TNR00260
       IP=F(I)                                                          TNR00270
       S=-1.                                                            TNR00280
       IF(IP.LT.0)S=1.                                                  TNR00290
       RVO(I)=S*RVI(I)+RVO(IABS(IP))                                    TNR00300
       I=P(I)                                                           TNR00310
      GOTO65                                                            TNR00320
900   RTN(1)=300                                                        TNR00330
      RTN(2)=IL                                                         TNR00340
      GOTO990                                                           TNR00350
1000  RTN(1)=0                                                          TNR00360
990   RETURN                                                            TNR00370
      END                                                               TNR00380
      SUBROUTINE RNROW(IL,VO)                                           ROW00010
C                                                                       ROW00020
C***** START OF RNET-STANDARD COMMON BLOCK *****************************XXX00030
C** COMMON: M-LONG ARRAYS: P,F,D,U,ARC,X,R; N-LONG: FROM,TO,C,H; PCAND**XXX00040
C** SIZE OF THESE ARRAYS MUST BE DECLARED IN THE USER'S CALLING PRGM. **XXX00050
      INTEGER   FROM,TO,F,D,P,R                                         XXX00060
      INTEGER   C                                                       XXX00070
      INTEGER   BT,PT,PAS,RTN,LPR,H,U,ARC,X,PCAND                       XXX00080
      DIMENSION P(1),F(1),D(1),U(1),ARC(1),X(1),R(1)                    XXX00090
      DIMENSION FROM(1),TO(1),C(1),H(1)                                 XXX00100
      DIMENSION PCAND(1)                                                XXX00110
      DIMENSION RTN(20),LPR(12),RTT(2)                                  XXX00120
      COMMON /A/FROM/B/TO/C/C/D/H/E/P/F/F/G/D/H/U/I/ARC/J/X/K/R/N/PCAND XXX00130
      COMMON /L/BT,MW,PT,M,N,IRT,MXIT,FRQ,P0,PBAR,CP,PAS,RTN,LPR,RTT,   XXX00140
     *          NCAND                                                   XXX00150
      DIMENSION IREVFL(4)                                               XXX00160
      COMMON /M/IREVFL,KARC,ICOM,ITH,MAXF,LNOD,MIC,MAC,NPE,IT,IT0,LGAM, XXX00170
     *          ISDB,TE0                                                XXX00180
C***** END OF RNET-STANDARD COMMON BLOCK *******************************XXX00190
C RNET USER-SERVICE ROUTINE:                                            ROW00200
C RETURNS VO=ROW 'IL' OF THE INVERSE.                                   ROW00210
      INTEGER VI(1),VO(1)                                               ROW00220
      IF(IL.LE.0.OR.IL.GT.M)GOTO900                                     ROW00230
       DO 70 I=1,M                                                      ROW00240
70     VO(I)=0                                                          ROW00250
      IS=-1                                                             ROW00260
      IF(F(IL).LT.0)IS=1                                                ROW00270
      ILDP=D(IL)                                                        ROW00280
      I=IL                                                              ROW00290
75    VO(I)=IS                                                          ROW00300
       I=P(I)                                                           ROW00310
      IF(D(I).GT.ILDP)GOTO75                                            ROW00320
      GOTO1000                                                          ROW00330
900   RTN(1)=300                                                        ROW00340
      RTN(2)=IL                                                         ROW00350
      GOTO990                                                           ROW00360
1000  RTN(1)=0                                                          ROW00370
990   RETURN                                                            ROW00380
      END                                                               ROW00390
      SUBROUTINE RNFTNI(IL,VI,VO)                                       TNI00010
C                                                                       TNI00020
C***** START OF RNET-STANDARD COMMON BLOCK *****************************XXX00030
C** COMMON: M-LONG ARRAYS: P,F,D,U,ARC,X,R; N-LONG: FROM,TO,C,H; PCAND**XXX00040
C** SIZE OF THESE ARRAYS MUST BE DECLARED IN THE USER'S CALLING PRGM. **XXX00050
      INTEGER   FROM,TO,F,D,P,R                                         XXX00060
      INTEGER   C                                                       XXX00070
      INTEGER   BT,PT,PAS,RTN,LPR,H,U,ARC,X,PCAND                       XXX00080
      DIMENSION P(1),F(1),D(1),U(1),ARC(1),X(1),R(1)                    XXX00090
      DIMENSION FROM(1),TO(1),C(1),H(1)                                 XXX00100
      DIMENSION PCAND(1)                                                XXX00110
      DIMENSION RTN(20),LPR(12),RTT(2)                                  XXX00120
      COMMON /A/FROM/B/TO/C/C/D/H/E/P/F/F/G/D/H/U/I/ARC/J/X/K/R/N/PCAND XXX00130
      COMMON /L/BT,MW,PT,M,N,IRT,MXIT,FRQ,P0,PBAR,CP,PAS,RTN,LPR,RTT,   XXX00140
     *          NCAND                                                   XXX00150
      DIMENSION IREVFL(4)                                               XXX00160
      COMMON /M/IREVFL,KARC,ICOM,ITH,MAXF,LNOD,MIC,MAC,NPE,IT,IT0,LGAM, XXX00170
     *          ISDB,TE0                                                XXX00180
C***** END OF RNET-STANDARD COMMON BLOCK *******************************XXX00190
C RNET USER-SERVICE ROUTINE:                                            TNI00200
C (VCTR OUT)=(BASIS INVRSE)*(VCTR IN).                                  TNI00210
      INTEGER VI(1),VO(1)                                               TNI00220
      IF(IL.NE.M)GOTO900                                                TNI00230
       DO 80 I=1,M                                                      TNI00240
80     VO(I)=0                                                          TNI00250
      I=R(IRT)                                                          TNI00260
90    IREG=VO(I)+VI(I)                                                  TNI00270
       IP=F(I)                                                          TNI00280
       IF(IP)100,130,110                                                TNI00290
100    VO(I)=IREG                                                       TNI00300
       IP=-IP                                                           TNI00310
       GOTO120                                                          TNI00320
110    VO(I)=-IREG                                                      TNI00330
120    VO(IP)=VO(IP)+IREG                                               TNI00340
       I=R(I)                                                           TNI00350
      GOTO90                                                            TNI00360
130   VO(I)=-IREG                                                       TNI00370
      GOTO1000                                                          TNI00380
900   RTN(1)=300                                                        TNI00390
      RTN(2)=IL                                                         TNI00400
      GOTO990                                                           TNI00410
1000  RTN(1)=0                                                          TNI00420
990   RETURN                                                            TNI00430
      END                                                               TNI00440
      SUBROUTINE RNFTNR(IL,RVI,RVO)                                     TNR00010
C                                                                       TNR00020
C***** START OF RNET-STANDARD COMMON BLOCK *****************************XXX00030
C** COMMON: M-LONG ARRAYS: P,F,D,U,ARC,X,R; N-LONG: FROM,TO,C,H; PCAND**XXX00040
C** SIZE OF THESE ARRAYS MUST BE DECLARED IN THE USER'S CALLING PRGM. **XXX00050
      INTEGER   FROM,TO,F,D,P,R                                         XXX00060
      INTEGER   C                                                       XXX00070
      INTEGER   BT,PT,PAS,RTN,LPR,H,U,ARC,X,PCAND                       XXX00080
      DIMENSION P(1),F(1),D(1),U(1),ARC(1),X(1),R(1)                    XXX00090
      DIMENSION FROM(1),TO(1),C(1),H(1)                                 XXX00100
      DIMENSION PCAND(1)                                                XXX00110
      DIMENSION RTN(20),LPR(12),RTT(2)                                  XXX00120
      COMMON /A/FROM/B/TO/C/C/D/H/E/P/F/F/G/D/H/U/I/ARC/J/X/K/R/N/PCAND XXX00130
      COMMON /L/BT,MW,PT,M,N,IRT,MXIT,FRQ,P0,PBAR,CP,PAS,RTN,LPR,RTT,   XXX00140
     *          NCAND                                                   XXX00150
      DIMENSION IREVFL(4)                                               XXX00160
      COMMON /M/IREVFL,KARC,ICOM,ITH,MAXF,LNOD,MIC,MAC,NPE,IT,IT0,LGAM, XXX00170
     *          ISDB,TE0                                                XXX00180
C***** END OF RNET-STANDARD COMMON BLOCK *******************************XXX00190
C RNET USER-SERVICE ROUTINE:                                            TNR00200
C SAME AS RNFTNI BUT FOR REAL VI,VO.                                    TNR00210
      REAL    RVI(1),RVO(1)                                             TNR00220
      IF(IL.NE.M)GOTO900                                                TNR00230
       DO 85 I=1,M                                                      TNR00240
85     RVO(I)=0.                                                        TNR00250
      I=R(IRT)                                                          TNR00260
95    REG=RVO(I)+RVI(I)                                                 TNR00270
       IP=F(I)                                                          TNR00280
       IF(IP)105,135,115                                                TNR00290
105    RVO(I)=REG                                                       TNR00300
       IP=-IP                                                           TNR00310
       GOTO125                                                          TNR00320
115    RVO(I)=-REG                                                      TNR00330
125    RVO(IP)=RVO(IP)+REG                                              TNR00340
       I=R(I)                                                           TNR00350
      GOTO95                                                            TNR00360
135   RVO(I)=-REG                                                       TNR00370
1000  RTN(1)=0                                                          TNR00380
990   RETURN                                                            TNR00390
900   RTN(1)=300                                                        TNR00400
      RTN(2)=IL                                                         TNR00410
      GOTO990                                                           TNR00420
      END                                                               TNR00430
      SUBROUTINE RNCOL(IL,VO)                                           COL00010
C                                                                       COL00020
C***** START OF RNET-STANDARD COMMON BLOCK *****************************XXX00030
C** COMMON: M-LONG ARRAYS: P,F,D,U,ARC,X,R; N-LONG: FROM,TO,C,H; PCAND**XXX00040
C** SIZE OF THESE ARRAYS MUST BE DECLARED IN THE USER'S CALLING PRGM. **XXX00050
      INTEGER   FROM,TO,F,D,P,R                                         XXX00060
      INTEGER   C                                                       XXX00070
      INTEGER   BT,PT,PAS,RTN,LPR,H,U,ARC,X,PCAND                       XXX00080
      DIMENSION P(1),F(1),D(1),U(1),ARC(1),X(1),R(1)                    XXX00090
      DIMENSION FROM(1),TO(1),C(1),H(1)                                 XXX00100
      DIMENSION PCAND(1)                                                XXX00110
      DIMENSION RTN(20),LPR(12),RTT(2)                                  XXX00120
      COMMON /A/FROM/B/TO/C/C/D/H/E/P/F/F/G/D/H/U/I/ARC/J/X/K/R/N/PCAND XXX00130
      COMMON /L/BT,MW,PT,M,N,IRT,MXIT,FRQ,P0,PBAR,CP,PAS,RTN,LPR,RTT,   XXX00140
     *          NCAND                                                   XXX00150
      DIMENSION IREVFL(4)                                               XXX00160
      COMMON /M/IREVFL,KARC,ICOM,ITH,MAXF,LNOD,MIC,MAC,NPE,IT,IT0,LGAM, XXX00170
     *          ISDB,TE0                                                XXX00180
C***** END OF RNET-STANDARD COMMON BLOCK *******************************XXX00190
C RNET USER-SERVICE ROUTINE:                                            COL00200
C RETURNS VO=COL 'IL' OF THE INVERSE.                                   COL00210
      INTEGER VI(1),VO(1)                                               COL00220
      IF(IL.LE.0.OR.IL.GT.M)GOTO900                                     COL00230
      DO  140 I=1,M                                                     COL00240
140   VO(I)=0                                                           COL00250
      J=IL                                                              COL00260
150   JS=-1                                                             COL00270
       JF=F(J)                                                          COL00280
       IF(JF.LT.0)JS=1                                                  COL00290
       VO(J)=JS                                                         COL00300
       J=IABS(JF)                                                       COL00310
      IF(J.NE.0)GOTO150                                                 COL00320
1000  RTN(1)=0                                                          COL00330
990   RETURN                                                            COL00340
900   RTN(1)=300                                                        COL00350
      RTN(2)=IL                                                         COL00360
      GOTO990                                                           COL00370
      END                                                               COL00380
      SUBROUTINE RNFAP(IL,NODCOM,VO)                                    FAP00010
C                                                                       FAP00020
C***** START OF RNET-STANDARD COMMON BLOCK *****************************XXX00030
C** COMMON: M-LONG ARRAYS: P,F,D,U,ARC,X,R; N-LONG: FROM,TO,C,H; PCAND**XXX00040
C** SIZE OF THESE ARRAYS MUST BE DECLARED IN THE USER'S CALLING PRGM. **XXX00050
      INTEGER   FROM,TO,F,D,P,R                                         XXX00060
      INTEGER   C                                                       XXX00070
      INTEGER   BT,PT,PAS,RTN,LPR,H,U,ARC,X,PCAND                       XXX00080
      DIMENSION P(1),F(1),D(1),U(1),ARC(1),X(1),R(1)                    XXX00090
      DIMENSION FROM(1),TO(1),C(1),H(1)                                 XXX00100
      DIMENSION PCAND(1)                                                XXX00110
      DIMENSION RTN(20),LPR(12),RTT(2)                                  XXX00120
      COMMON /A/FROM/B/TO/C/C/D/H/E/P/F/F/G/D/H/U/I/ARC/J/X/K/R/N/PCAND XXX00130
      COMMON /L/BT,MW,PT,M,N,IRT,MXIT,FRQ,P0,PBAR,CP,PAS,RTN,LPR,RTT,   XXX00140
     *          NCAND                                                   XXX00150
      DIMENSION IREVFL(4)                                               XXX00160
      COMMON /M/IREVFL,KARC,ICOM,ITH,MAXF,LNOD,MIC,MAC,NPE,IT,IT0,LGAM, XXX00170
     *          ISDB,TE0                                                XXX00180
C***** END OF RNET-STANDARD COMMON BLOCK *******************************XXX00190
C RNET USER-SERVICE ROUTINE:                                            FAP00200
C RETURNS VO=EXPLICIT FAP(IL), AND                                      FAP00210
C 'NODCOM'=COMMON NODE OF FAP(IL).                                      FAP00220
      INTEGER VI(1),VO(1)                                               FAP00230
      IF(IL.LE.0.OR.IL.GT.N)GOTO900                                     FAP00240
      DO 160 I=1,M                                                      FAP00250
160   VO(I)=0                                                           FAP00260
      JFROM=FROM(IL)                                                    FAP00270
      JTO=TO(IL)                                                        FAP00280
      IDP=D(JFROM)-D(JTO)                                               FAP00290
      IF(IDP)170,220,180                                                FAP00300
170   K=JTO                                                             FAP00310
      KSGN=1                                                            FAP00320
      IDP=-IDP                                                          FAP00330
      GOTO190                                                           FAP00340
180   K=JFROM                                                           FAP00350
      KSGN=-1                                                           FAP00360
190   DO 200 I=1,IDP                                                    FAP00370
        KF=F(K)                                                         FAP00380
        VO(K)=KSGN                                                      FAP00390
        IF(KF.LT.0)VO(K)=-KSGN                                          FAP00400
200   K=IABS(KF)                                                        FAP00410
      IF(KSGN.LT.0)GOTO210                                              FAP00420
      JTO=K                                                             FAP00430
      GOTO220                                                           FAP00440
210   JFROM=K                                                           FAP00450
220   IF(JTO.EQ.JFROM)GOTO230                                           FAP00460
        JTOF=F(JTO)                                                     FAP00470
        JFROMF=F(JFROM)                                                 FAP00480
        VO(JFROM)=-1                                                    FAP00490
        IF(JFROMF.LT.0)VO(JFROM)=1                                      FAP00500
        VO(JTO)=1                                                       FAP00510
        IF(JTOF.LT.0)VO(JTO)=-1                                         FAP00520
        JTO=IABS(JTOF)                                                  FAP00530
        JFROM=IABS(JFROMF)                                              FAP00540
      GOTO220                                                           FAP00550
230   NODCOM=JTO                                                        FAP00560
1000  RTN(1)=0                                                          FAP00570
990   RETURN                                                            FAP00580
900   RTN(1)=300                                                        FAP00590
      RTN(2)=IL                                                         FAP00600
      GOTO990                                                           FAP00610
      END                                                               FAP00620
      SUBROUTINE RNSTEP(IL,LV)                                          TEP00010
C                                                                       TEP00020
C***** START OF RNET-STANDARD COMMON BLOCK *****************************XXX00030
C** COMMON: M-LONG ARRAYS: P,F,D,U,ARC,X,R; N-LONG: FROM,TO,C,H; PCAND**XXX00040
C** SIZE OF THESE ARRAYS MUST BE DECLARED IN THE USER'S CALLING PRGM. **XXX00050
      INTEGER   FROM,TO,F,D,P,R                                         XXX00060
      INTEGER   C                                                       XXX00070
      INTEGER   BT,PT,PAS,RTN,LPR,H,U,ARC,X,PCAND                       XXX00080
      DIMENSION P(1),F(1),D(1),U(1),ARC(1),X(1),R(1)                    XXX00090
      DIMENSION FROM(1),TO(1),C(1),H(1)                                 XXX00100
      DIMENSION PCAND(1)                                                XXX00110
      DIMENSION RTN(20),LPR(12),RTT(2)                                  XXX00120
      COMMON /A/FROM/B/TO/C/C/D/H/E/P/F/F/G/D/H/U/I/ARC/J/X/K/R/N/PCAND XXX00130
      COMMON /L/BT,MW,PT,M,N,IRT,MXIT,FRQ,P0,PBAR,CP,PAS,RTN,LPR,RTT,   XXX00140
     *          NCAND                                                   XXX00150
      DIMENSION IREVFL(4)                                               XXX00160
      COMMON /M/IREVFL,KARC,ICOM,ITH,MAXF,LNOD,MIC,MAC,NPE,IT,IT0,LGAM, XXX00170
     *          ISDB,TE0                                                XXX00180
C***** END OF RNET-STANDARD COMMON BLOCK *******************************XXX00190
C RNET USER-SERVICE ROUTINE:                                            TEP00200
C DO ONE STEP OF SIMPLEX METHOD                                         TEP00210
C FOR ENTERING NONBASIC ARC 'IL'.                                       TEP00220
      IF(IL.LT.1.OR.IL.GT.N)GOTO900                                     TEP00230
      IFR=FROM(IL)                                                      TEP00240
      ITO=TO(IL)                                                        TEP00250
      IF(ARC(IFR).EQ.IL)GOTO900                                         TEP00260
      IF(ARC(ITO).EQ.IL)GOTO900                                         TEP00270
C 'IL' IS NONBASIC:                                                     TEP00280
      KARC=IL                                                           TEP00290
      CALL RNATL(NUMRTN)                                                TEP00300
      IF(NUMRTN.EQ.1)GOTO265                                            TEP00310
      LV=ARC(LNOD)                                                      TEP00320
      CALL RNUPDF(NUMRTN)                                               TEP00330
      IF(NUMRTN.EQ.1)GOTO264                                            TEP00340
      IF(ITH.NE.3)GOTO270                                               TEP00350
263   RTN(6)=RTN(6)+1                                                   TEP00360
      LV=-1                                                             TEP00370
      GOTO990                                                           TEP00380
264   RTN(1)=30                                                         TEP00390
      LV=MW                                                             TEP00400
      GOTO990                                                           TEP00410
265   LV=ARC(LNOD)                                                      TEP00420
      IF(ITH.EQ.3)GOTO263                                               TEP00430
      RTN(5)=RTN(5)+1                                                   TEP00440
270   CALL RNPIVT                                                       TEP00450
      RTN(4)=RTN(4)+1                                                   TEP00460
990   RETURN                                                            TEP00470
900   RTN(1)=300                                                        TEP00480
      RTN(2)=IL                                                         TEP00490
      GOTO990                                                           TEP00500
      END                                                               TEP00510
      SUBROUTINE RNWIPA(IO)                                             IPA00010
C                                                                       IPA00020
C***** START OF RNET-STANDARD COMMON BLOCK *****************************XXX00030
C** COMMON: M-LONG ARRAYS: P,F,D,U,ARC,X,R; N-LONG: FROM,TO,C,H; PCAND**XXX00040
C** SIZE OF THESE ARRAYS MUST BE DECLARED IN THE USER'S CALLING PRGM. **XXX00050
      INTEGER   FROM,TO,F,D,P,R                                         XXX00060
      INTEGER   C                                                       XXX00070
      INTEGER   BT,PT,PAS,RTN,LPR,H,U,ARC,X,PCAND                       XXX00080
      DIMENSION P(1),F(1),D(1),U(1),ARC(1),X(1),R(1)                    XXX00090
      DIMENSION FROM(1),TO(1),C(1),H(1)                                 XXX00100
      DIMENSION PCAND(1)                                                XXX00110
      DIMENSION RTN(20),LPR(12),RTT(2)                                  XXX00120
      COMMON /A/FROM/B/TO/C/C/D/H/E/P/F/F/G/D/H/U/I/ARC/J/X/K/R/N/PCAND XXX00130
      COMMON /L/BT,MW,PT,M,N,IRT,MXIT,FRQ,P0,PBAR,CP,PAS,RTN,LPR,RTT,   XXX00140
     *          NCAND                                                   XXX00150
      DIMENSION IREVFL(4)                                               XXX00160
      COMMON /M/IREVFL,KARC,ICOM,ITH,MAXF,LNOD,MIC,MAC,NPE,IT,IT0,LGAM, XXX00170
     *          ISDB,TE0                                                XXX00180
C***** END OF RNET-STANDARD COMMON BLOCK *******************************XXX00190
C BOOTSTRAP FOR INITIAL PAR PRINTOUT.                                   IPA00200
      IFLAG=0                                                           IPA00210
      PAS=0                                                             IPA00220
      CP=0.0                                                            IPA00230
      CALL RNWPAR(IO,IFLAG)                                             IPA00240
      RETURN                                                            IPA00250
      END                                                               IPA00260
      SUBROUTINE RNWFPA(IO)                                             FPA00010
C                                                                       FPA00020
C***** START OF RNET-STANDARD COMMON BLOCK *****************************XXX00030
C** COMMON: M-LONG ARRAYS: P,F,D,U,ARC,X,R; N-LONG: FROM,TO,C,H; PCAND**XXX00040
C** SIZE OF THESE ARRAYS MUST BE DECLARED IN THE USER'S CALLING PRGM. **XXX00050
      INTEGER   FROM,TO,F,D,P,R                                         XXX00060
      INTEGER   C                                                       XXX00070
      INTEGER   BT,PT,PAS,RTN,LPR,H,U,ARC,X,PCAND                       XXX00080
      DIMENSION P(1),F(1),D(1),U(1),ARC(1),X(1),R(1)                    XXX00090
      DIMENSION FROM(1),TO(1),C(1),H(1)                                 XXX00100
      DIMENSION PCAND(1)                                                XXX00110
      DIMENSION RTN(20),LPR(12),RTT(2)                                  XXX00120
      COMMON /A/FROM/B/TO/C/C/D/H/E/P/F/F/G/D/H/U/I/ARC/J/X/K/R/N/PCAND XXX00130
      COMMON /L/BT,MW,PT,M,N,IRT,MXIT,FRQ,P0,PBAR,CP,PAS,RTN,LPR,RTT,   XXX00140
     *          NCAND                                                   XXX00150
      DIMENSION IREVFL(4)                                               XXX00160
      COMMON /M/IREVFL,KARC,ICOM,ITH,MAXF,LNOD,MIC,MAC,NPE,IT,IT0,LGAM, XXX00170
     *          ISDB,TE0                                                XXX00180
C***** END OF RNET-STANDARD COMMON BLOCK *******************************XXX00190
C BOOTSTRAP FOR INITIAL PAR PRINTOUT.                                   FPA00200
      IFLAG=1                                                           FPA00210
      CALL RNWPAR(IO,IFLAG)                                             FPA00220
      RETURN                                                            FPA00230
      END                                                               FPA00240
      SUBROUTINE RNWPAR(IO,IFLAG)                                       PAR00010
C                                                                       PAR00020
C***** START OF RNET-STANDARD COMMON BLOCK *****************************XXX00030
C** COMMON: M-LONG ARRAYS: P,F,D,U,ARC,X,R; N-LONG: FROM,TO,C,H; PCAND**XXX00040
C** SIZE OF THESE ARRAYS MUST BE DECLARED IN THE USER'S CALLING PRGM. **XXX00050
      INTEGER   FROM,TO,F,D,P,R                                         XXX00060
      INTEGER   C                                                       XXX00070
      INTEGER   BT,PT,PAS,RTN,LPR,H,U,ARC,X,PCAND                       XXX00080
      DIMENSION P(1),F(1),D(1),U(1),ARC(1),X(1),R(1)                    XXX00090
      DIMENSION FROM(1),TO(1),C(1),H(1)                                 XXX00100
      DIMENSION PCAND(1)                                                XXX00110
      DIMENSION RTN(20),LPR(12),RTT(2)                                  XXX00120
      COMMON /A/FROM/B/TO/C/C/D/H/E/P/F/F/G/D/H/U/I/ARC/J/X/K/R/N/PCAND XXX00130
      COMMON /L/BT,MW,PT,M,N,IRT,MXIT,FRQ,P0,PBAR,CP,PAS,RTN,LPR,RTT,   XXX00140
     *          NCAND                                                   XXX00150
      DIMENSION IREVFL(4)                                               XXX00160
      COMMON /M/IREVFL,KARC,ICOM,ITH,MAXF,LNOD,MIC,MAC,NPE,IT,IT0,LGAM, XXX00170
     *          ISDB,TE0                                                XXX00180
C***** END OF RNET-STANDARD COMMON BLOCK *******************************XXX00190
C RNET USER-SERVICE ROUTINE:                                            PAR00200
C PRINTS INITIAL RUN PARAMETERS.                                        PAR00210
      DIMENSION PB(4,2)                                                 PAR00220
      DATA VER/4H3.61/                                                  PAR00231
      DATA INL/4HINIT/,IFL/4H FIN/,                                     PAR00240
     *PB/4HMIN ,4HCST ,4HNET ,4HFLOW,                                   PAR00250
     *   4H    ,4HMAXI,4HMUM ,4HFLOW/,                                  PAR00260
     *ICND/4HCAND/,BL4/4H    /                                          PAR00270
C                                                                       PAR00280
      MW=(2**(BT-2)-1)*2+1                                              PAR00290
      IF(IFLAG.NE.0)GOTO10                                              PAR00300
C PRINT INITIAL PARAMATERS:                                             PAR00310
      WRITE(IO,914)                                                     PAR00320
      WRITE(IO,915)VER,INL                                              PAR00330
      I=PT+1                                                            PAR00340
      NNCA=BL4                                                          PAR00350
      IF(NCAND.GT.0)NNCA=ICND                                           PAR00360
      WRITE(IO,900)MW,BT,PT,                                            PAR00370
     * (PB(K,I),K=1,4),M,N,IRT,                                         PAR00380
     * MXIT,FRQ,NNCA,PAS,P0,PBAR,NCAND                                  PAR00390
      RETURN                                                            PAR00400
C                                                                       PAR00410
10    IF(IFLAG.NE.1)RETURN                                              PAR00420
C PRINT FINAL RUN PARAMETERS.                                           PAR00430
      WRITE(IO,915)VER,IFL                                              PAR00440
      I=PT+1                                                            PAR00450
      NNCA=BL4                                                          PAR00460
      IF(NCAND.GT.0)NNCA=ICND                                           PAR00470
      WRITE(IO,900)MW,BT,PT,                                            PAR00480
     * (PB(K,I),K=1,4),M,N,IRT,                                         PAR00490
     * MXIT,FRQ,NNCA,PAS,P0,PBAR,NCAND                                  PAR00500
      WRITE(IO,9001)CP,NPE                                              PAR00510
      WRITE(IO,901)(I,RTN(I),I=1,20)                                    PAR00520
      IF(RTN(1).NE.0)WRITE(IO,903)                                      PAR00530
      WRITE(IO,902)(RTT(I),I=1,2)                                       PAR00540
      RETURN                                                            PAR00550
C FORMATS:                                                              PAR00560
900   FORMAT(07H MW   :,I18,9H (MAX INT,                                PAR00570
     *9HEGER; FOR,I3,16H-BIT WORDLENGTH),                               PAR00580
     */7H PT   :,I18,16H (PROBLEM TYPE: ,                               PAR00590
     *4A4,1H),/7H M    :,I18,8H (NODES),                                PAR00600
     */7H N    :,I18,7H (ARCS),/7H IRT  :,                              PAR00610
     *I18,26H (ROOT NODE FOR ALL TREES),                                PAR00620
     */7H MXIT :,I18,16H (MAXIMUM PIVOTS,                               PAR00630
     *8H CUTOFF),/7H FRQ  :,F18.2,                                      PAR00640
     *30H (PRICING FREQUENCY, IN % OF N,                                PAR00650
     *A4,1H),/7H PAS  :,I18,                                            PAR00660
     *30H (NO.OF PASSES OF GRAD'L PENAL,                                PAR00670
     *10HTY METHOD),/7H P0   :,F18.2,                                   PAR00680
     *30H (CONSTANT PENALTY COST MULTIP,                                
     *05HLIER),/7H PBAR :,F18.2,                                        PAR00700
     *30H (BASE OF EXPONENTIAL MULTIPLI,                                PAR00710
     *09HER TO P0),/7H NCAND:,I18,                                      PAR00720
     *30H (NO.OF PRICING CANDIDATES IN ,                                PAR00730
     *09H'PCAND'  ,/29X,                                                PAR00740
     *29H=0: NO 'PCAND' LIST IS USED.))                                 PAR00750
9001  FORMAT(7H CP   :,F18.2,9H (LAST CO,                               PAR00760
     *27HMPOSITE PENALTY MULTIPLIER),/                                  PAR00770
     * 7H NPE  :,I18,14H (LAST PENALTY,                                 PAR00780
     *22H COST FOR ARTIFICIALS)/)                                       PAR00790
901   FORMAT(/18H COMPLETION CODES:/,                                   PAR00800
     *(5(5H RTN(,I2,2H)=,I11,2H; )))                                    PAR00810
902   FORMAT(/15H RNET RUN TIMES/,                                      PAR00820
     *8H INIT'N=,F12.4,12H  ALGORITHM=,                                 PAR00830
     *F12.4,09H SECONDS./)                                              PAR00840
903   FORMAT(/18H ERROR DETECTED - ,                                    PAR00850
     *30HEXAMINE THE ABOVE RETURN CODES/)                               PAR00860
914   FORMAT(01H1)                                                      PAR00870
915   FORMAT(/13H RNET-VERSION,A4,                                      PAR00880
     *3H - ,A4,18H'L RUN PARAMETERS:/)                                  PAR00890
      END                                                               PAR00900
      SUBROUTINE RNWSOL(IO,LB,LR,LC,JF,                                 SOL00010
     *                  JT,NF,NT,NHITS)                                 SOL00020
C***** START OF RNET-STANDARD COMMON BLOCK *****************************XXX00030
C** COMMON: M-LONG ARRAYS: P,F,D,U,ARC,X,R; N-LONG: FROM,TO,C,H; PCAND**XXX00040
C** SIZE OF THESE ARRAYS MUST BE DECLARED IN THE USER'S CALLING PRGM. **XXX00050
      INTEGER   FROM,TO,F,D,P,R                                         XXX00060
      INTEGER   C                                                       XXX00070
      INTEGER   BT,PT,PAS,RTN,LPR,H,U,ARC,X,PCAND                       XXX00080
      DIMENSION P(1),F(1),D(1),U(1),ARC(1),X(1),R(1)                    XXX00090
      DIMENSION FROM(1),TO(1),C(1),H(1)                                 XXX00100
      DIMENSION PCAND(1)                                                XXX00110
      DIMENSION RTN(20),LPR(12),RTT(2)                                  XXX00120
      COMMON /A/FROM/B/TO/C/C/D/H/E/P/F/F/G/D/H/U/I/ARC/J/X/K/R/N/PCAND XXX00130
      COMMON /L/BT,MW,PT,M,N,IRT,MXIT,FRQ,P0,PBAR,CP,PAS,RTN,LPR,RTT,   XXX00140
     *          NCAND                                                   XXX00150
      DIMENSION IREVFL(4)                                               XXX00160
      COMMON /M/IREVFL,KARC,ICOM,ITH,MAXF,LNOD,MIC,MAC,NPE,IT,IT0,LGAM, XXX00170
     *          ISDB,TE0                                                XXX00180
C***** END OF RNET-STANDARD COMMON BLOCK *******************************XXX00190
C RNET USER-SERVICE ROUTINE: PRINTS                                     SOL00200
C SELECTED SOL'N REPORT ON UNIT 'IO'.                                   SOL00210
      DIMENSION A1(2,3),A2(3,3),A3(2,4)                                 SOL00220
      DIMENSION NA(2)                                                   SOL00230
      DATA VER/4H3.61/                                                  SOL00241
      DATA A1/4HBASI,4HC   ,4HALL ,                                     SOL00250
     *4H    ,4HNONB,4HASIC/,A2/4HGIVE,                                  SOL00260
     *4HN&AR,4HTFCL,4H   G,4HIVEN,                                      SOL00270
     *4H    ,4H ART,4HIFIC,4HIAL /,                                     SOL00280
     *A3/4H   A,4HNY  ,4H  ZE,4HRO  ,                                   SOL00290
     *4HPOSI,4HTIVE,4HSATU,4HRATD/,                                     SOL00300
     *NA/4HNODE,4H ARC/,BL/1H /,                                        SOL00310
     *SAT/1HS/                                                          SOL00320
C                                                                       SOL00330
      IB=LB                                                             SOL00340
      IR=LR                                                             SOL00350
      IC=LC                                                             SOL00360
      IF(IB.EQ.3.AND.IR.EQ.1)IR=2                                       SOL00370
      IF(IB.EQ.2.AND.IR.EQ.3)IB=1                                       SOL00380
      IF(IR.EQ.1.AND.IC.EQ.4)IR=2                                       SOL00390
      I=NA(2)                                                           SOL00400
      IF(IB.EQ.1)I=NA(1)                                                SOL00410
      WRITE(IO,904)VER,I,RTN(2),                                        SOL00420
     *RTN(3),MW                                                         SOL00430
      IFND=0                                                            SOL00440
      IF(LB.EQ.3.AND.LR.EQ.3)GOTO130                                    SOL00450
      IF(LR.EQ.3.AND.LC.EQ.4)GOTO130                                    SOL00460
      IF(IB.LT.1.OR.IB.GT.3)GOTO800                                     SOL00470
      IF(IR.LT.1.OR.IR.GT.3)GOTO800                                     SOL00480
      IF(IC.LT.1.OR.IC.GT.4)GOTO800                                     SOL00490
      IF(JF.LT.1.OR.NF.LT.1)GOTO800                                     SOL00500
      IF(JT.GT.N.OR.NT.GT.M)GOTO800                                     SOL00510
      IF(JF.GT.JT.OR.NF.GT.NT)GOTO800                                   SOL00520
      WRITE(IO,905)(A1(K1,IB),K1=1,2),                                  SOL00530
     *(A2(K2,IR),K2=1,3),                                               SOL00540
     *(A3(K3,IC),K3=1,2),JF,JT,NF,NT                                    SOL00550
      IEX=N                                                             SOL00560
      IF(IB.EQ.1)IEX=M                                                  SOL00570
      NUM=0                                                             SOL00580
      DO 100 I=1,IEX                                                    SOL00590
       IF(IB.NE.1)GOTO20                                                SOL00600
       CALL RNBPRL(I)                                                   SOL00610
       GOTO30                                                           SOL00620
20     CALL RNAPRL(I)                                                   SOL00630
       IF(IB.EQ.2)GOTO30                                                SOL00640
       IF(LPR(5).EQ.1)GOTO100                                           SOL00650
30     L2=LPR(2)                                                        SOL00660
       L3=LPR(3)                                                        SOL00670
       L4=LPR(4)                                                        SOL00680
       IF(L2.EQ.0)GOTO40                                                SOL00690
       IF(L2.LT.JF.OR.L2.GT.JT)GOTO100                                  SOL00700
40     IF(L3.GE.NF.AND.L3.LE.NT)GOTO50                                  SOL00710
       IF(L4.GE.NF.AND.L4.LE.NT)GOTO50                                  SOL00720
       GOTO100                                                          SOL00730
50     IF(IR.EQ.1)GOTO60                                                SOL00740
       IF(IR.EQ.2.AND.L2.EQ.0)GOTO100                                   SOL00750
       IF(IR.EQ.3.AND.L2.NE.0)GOTO100                                   SOL00760
60     IF(IC.EQ.1)GOTO70                                                SOL00770
       L9=LPR(9)                                                        SOL00780
       IF(IC.EQ.2.AND.L9.EQ.0)GOTO70                                    SOL00790
       IF(IC.EQ.3.AND.L9.GT.0)GOTO70                                    SOL00800
       L0=LPR(10)                                                       SOL00810
       IF(IC.EQ.4.AND.L9.EQ.L0)GOTO70                                   SOL00820
       GOTO100                                                          SOL00830
70     IF(IFND.EQ.0)WRITE(IO,906)                                       SOL00840
       IFND=1                                                           SOL00850
       S=BL                                                             SOL00860
       IF(LPR(1).EQ.0)GOTO90                                            SOL00870
C BASIC ARCS:                                                           SOL00880
       IF(L2.NE.0)GOTO80                                                SOL00890
C BASIC ARTIFICIALS:                                                    SOL00900
       WRITE(IO,908)(LPR(K),K=1,5),S,                                   SOL00910
     * (LPR(K1),K1=6,9),LPR(11),LPR(12)                                 SOL00920
       GOTO95                                                           SOL00930
C BASIC GIVEN ARCS:                                                     SOL00940
80     IF(LPR(9).EQ.LPR(10))S=SAT                                       SOL00950
       IF(LPR(1).NE.0)WRITE(IO,907)                                     SOL00960
     * (LPR(K),K=1,5),S,(LPR(K1),K1=6,12)                               SOL00970
       GOTO95                                                           SOL00980
C NONBASIC ARCS:                                                        SOL00990
90     IF(LPR(9).EQ.LPR(10))S=SAT                                       SOL01000
       WRITE(IO,909)(LPR(K),K=2,5),S,                                   SOL01010
     * (LPR(K1),K1=8,12)                                                SOL01020
95    NUM=NUM+1                                                         SOL01030
100   CONTINUE                                                          SOL01040
C     IF(IB.NE.2)GOTO120                                                SOL01050
C     IF(IR.NE.1)GOTO120                                                SOL01060
      IF(IB.NE.2.OR.IR.NE.1)GOTO120                                     SOL01070
C APPEND BASIC ARTIFICIALS:                                             SOL01080
      DO 110 I=1,M                                                      SOL01090
       IF(ARC(I).NE.0)GOTO110                                           SOL01100
       IX=X(I)                                                          SOL01110
       IF(IC.EQ.2.AND.IX.NE.0)GOTO110                                   SOL01120
       IF(IC.EQ.3.AND.IX.EQ.0)GOTO110                                   SOL01130
       IF(IFND.EQ.0)WRITE(IO,906)                                       SOL01140
       CALL RNBPRL(I)                                                   SOL01150
       WRITE(IO,908)(LPR(K),K=1,5),BL,                                  SOL01160
     * (LPR(K1),K1=6,9),LPR(11),LPR(12)                                 SOL01170
       IFND=1                                                           SOL01180
       NUM=NUM+1                                                        SOL01190
110   CONTINUE                                                          SOL01200
120   IF(IFND.EQ.0)WRITE(IO,910)                                        SOL01210
      IF(IFND.NE.0)WRITE(IO,913)NUM                                     SOL01220
      GOTO1000                                                          SOL01230
130   WRITE(IO,911)                                                     SOL01240
800   WRITE(IO,912)IO,LB,LR,LC,JF,                                      SOL01250
     *                      JT,NF,NT                                    SOL01260
      RTN(1)=310                                                        SOL01270
1000  NHITS=NUM                                                         SOL01280
      RETURN                                                            SOL01290
C FORMATS:                                                              SOL01300
904   FORMAT(9H1 RNET-V.,A4,9H - SOLUTI,                                SOL01310
     *12HON REPORT - ,A4,12HS SECTION.  ,                               SOL01320
     *22H  (OBJ FUNCTION VALUE=,                                        SOL01330
     *I12,1H+,I5,1H*,I12,1H)/)                                          SOL01340
905   FORMAT(/5X,13HARCS SELECTED,                                      SOL01350
     *20H FOR THIS LISTING:  ,2A4,1X,3A4,                               SOL01360
     *13H ARCS HAVING ,2A4,6H FLOW,/,                                   SOL01370
     *38X,25HAND WITH GIVEN ARC-IDS IN,                                 SOL01380
     *16H THE RANGE: FROM,I7,3H TO,I7,1H,/                              ,SOL0139
     *38X,25HAND INVOLVING NODE-IDS IN,                                 SOL01400
     *16H THE RANGE: FROM,I7,3H TO,I7,                                  SOL01410
     *1H.,//)                                                           SOL01420
906   FORMAT(/22H  BASIS   ARC-ID .....,                                SOL01430
     *25H.ARC... B/NB PREO DEPTH  ,                                     SOL01440
     *30HDUALS(IF B)  ...ARC....  ..GIV,                                SOL01450
     *28HEN...  ...GIVEN..   COMPUTED/,                                 SOL01460
     *30H  NODEID  0=ARTF .FROM. ...TO ,                                SOL01470
     *29H1/0  RDER       REDCST(IF NB),                                 SOL01480
     *30H ...FLOW...  .UPPER-BND  .UNIT,                                SOL01490
     *17H-COST   FLOW*COST/)                                            SOL01500
907   FORMAT(1X,4I7,I3,A1,2I5,5I12)                                     SOL01510
908   FORMAT(1X,4I7,I3,A1,2I5,2I12,                                     SOL01520
     *10X,2H--,2I12)                                                    SOL01530
909   FORMAT(6X,2H--,3I7,I3,A1,                                         SOL01540
     *2(3X,2H--),5I12)                                                  SOL01550
910   FORMAT(/10X,18HNO SUCH ARCS FOUND/)                               SOL01560
911   FORMAT(//18H THE SELECTED ARCS,                                   SOL01570
     *13H CANNOT EXIST)                                                 SOL01580
912   FORMAT(20H BAD CALL TO RNWSOL:,                                   SOL01590
     *4I3,4I8//)                                                        SOL01600
913   FORMAT(//12H  THERE ARE ,                                         SOL01610
     *I5,15H  ENTRIES ABOVE//)                                          SOL01620
      END                                                               SOL01630

