FICO
FICO Xpress Optimization Examples Repository
FICO Optimization Community FICO Xpress Optimization Home
Back to examples browserPrevious exampleNext example

Definition of a network

Description
  • definition of a data structure to represent arcs in a network with source, sink, and other properties
  • accessing the different record fields
  • initialization of records with data from a text file
  • selection of record fields in initializations (arcs2.mos)
  • separate initialization of record fields (arcs3.mos)
  • sets and lists of records, using type constructors (arcs4.mos)
  • constant record definition, sets of constant records (arcs5.mos)
Further explanation of this example: 'Mosel User Guide', Section 8.6 Records


Source Files
By clicking on a file name, a preview is opened at the bottom of this page.
arcs.mos[download]
arcs2.mos[download]
arcs3.mos[download]
arcs4.mos[download]
arcs5.mos[download]

Data Files





arcs.dat

! Data file for `arcs.mos'

ARC: [(1) ["A" "B" 2]
      (2) ["A" "D" 4]
      (3) ["A" "C" 7]
      (4) ["B" "F" 4]
      (5) ["B" "D" 3]
      (6) ["C" "B" 5]
      (7) ["C" "D" 1]
      (8) ["C" "E" 1]
      (9) ["D" "F" 2]
     (10) ["D" "E" 5]
     (11) ["E" "F" 8]]

ARCDEF: [(1) ["A" "B"]
         (2) ["A" "D"]
         (3) ["A" "C"]
         (4) ["B" "F"]
         (5) ["B" "D"]
         (6) ["C" "B"]
         (7) ["C" "D"]
         (8) ["C" "E"]
         (9) ["D" "F"]
        (10) ["D" "E"]
        (11) ["E" "F"]]

COST: [(1) 2 (2) 4 (3) 7 (4) 4 (5) 3 (6) 5 (7) 1 (8) 1 (9) 2 (10) 5 (11) 8]

Back to examples browserPrevious exampleNext example