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

Output formatting for a transportation model

Description
  • small LP problem
  • generate a nice printed output
  • using dynamic arrays for representing sparse data structures
  • reading several data arrays from a single data file
Further explanation of this example: 'Mosel User Guide', Section 3.2 A transport example and Section 10.1 Producing formatted output.

The section 'Traditional embedding: solving multiple scenarios' of the Xpress Whitepaper 'Embedding Optimization Algorithms' describes how to embed a similar transportation model into an application.


Source Files

Data Files





transprt.dat

! Data file for 'transprt.mos'

DEMAND: [ (Scotland) 2840 (North) 2800 (SWest) 2600
          (SEast) 2820 (Midlands) 2750 ]

PlantCapCost: [
(Corby)   [ 3000 1700 ]
(Deeside) [ 2700 1600 ]
(Glasgow) [ 4500 2000 ]
(Oxford)  [ 4000 2100 ]
]

DistTCasp: [
(Corby   Scotland) [   0    0 ]
(Corby   North)    [ 400 1000 ]
(Corby   SWest)    [ 400 1000 ]
(Corby   SEast)    [ 300 1000 ]
(Corby   Midlands) [ 100 2000 ]
(Deeside Scotland) [ 500 1000 ]
(Deeside North)    [ 200 2000 ]
(Deeside SWest)    [ 200 1000 ]
(Deeside SEast)    [ 200 1000 ]
(Deeside Midlands) [ 400  300 ]
(Glasgow Scotland) [ 200 3000 ]
(Glasgow North)    [ 400 2000 ]
(Glasgow SWest)    [ 500 1000 ]
(Glasgow SEast)    [ 900  200 ]
(Glasgow Midlands) [   0    0 ]
(Oxford  Scotland) [ 800    0 ]
(Oxford  North)    [ 600 2000 ]
(Oxford  SWest)    [ 300 2000 ]
(Oxford  SEast)    [ 200 2000 ]
(Oxford  Midlands) [ 400  500 ]
]

FUELCOST: 17

Back to examples browserPrevious exampleNext example