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

Solve an LP and a MIP using Xpress-R

Description

This example shows how to solve LP and MIP models.



Further explanation of this example: Xpress R Reference Manual

solving_an_lp_and_a_mip_R.zip[download all files]

Source Files
By clicking on a file name, a preview is opened at the bottom of this page.
solving_an_lp_and_a_mip.R[download]

Data Files





flp.lp

\Problem name: FacilityLocation                                                 
\FICO Xpress v8.11.x, Hyper64, written 11:29:43, Mar 11, 2021

Minimize
 3000 x_1 + 4000 x_2 + 3500 x_3 + 8000 x_4 + 5000 x_5
 + 1425.8629262913018 y_1_1 + 1276.1978185735643 y_1_2
 + 1904.528153827414 y_1_3 + 1009.6853016875684 y_1_4
 + 1904.7246230766177 y_1_5 + 1859.2980827670544 y_1_6
 + 1117.5498256925493 y_2_1 + 1960.163836600259 y_2_2
 + 1093.2834788691252 y_2_3 + 1086.2183121498674 y_2_4
 + 1747.1865648403764 y_2_5 + 1360.366543987766 y_2_6
 + 1374.2048162966967 y_3_1 + 1982.5146470684558 y_3_2
 + 1464.9364307988435 y_3_3 + 1492.7141170483083 y_3_4
 + 1061.8083144072443 y_3_5 + 1689.017519587651 y_3_6
 + 1115.2105666697025 y_4_1 + 1998.7052713986486 y_4_2
 + 1050.0138094648719 y_4_3 + 1440.1086817961186 y_4_4
 + 1613.5540714021772 y_4_5 + 1151.5448717400432 y_4_6
 + 1767.7212317939848 y_5_1 + 1008.7369927205145 y_5_2
 + 1867.1635373029858 y_5_3 + 1485.479147406295 y_5_4
 + 1895.070082275197 y_5_5 + 1192.6461667753756 y_5_6

Subject To
Demand_1: y_1_1 + y_2_1 + y_3_1 + y_4_1 + y_5_1 = 2 
Demand_2: y_1_2 + y_2_2 + y_3_2 + y_4_2 + y_5_2 = 6 
Demand_3: y_1_3 + y_2_3 + y_3_3 + y_4_3 + y_5_3 = 4 
Demand_4: y_1_4 + y_2_4 + y_3_4 + y_4_4 + y_5_4 = 10 
Demand_5: y_1_5 + y_2_5 + y_3_5 + y_4_5 + y_5_5 = 7 
Demand_6: y_1_6 + y_2_6 + y_3_6 + y_4_6 + y_5_6 = 4 
Capacity_1: - 14 x_1 + y_1_1 + y_1_2 + y_1_3 + y_1_4 + y_1_5 + y_1_6 <= 0 
Capacity_2: - 11 x_2 + y_2_1 + y_2_2 + y_2_3 + y_2_4 + y_2_5 + y_2_6 <= 0 
Capacity_3: - 6 x_3 + y_3_1 + y_3_2 + y_3_3 + y_3_4 + y_3_5 + y_3_6 <= 0 
Capacity_4: - 16 x_4 + y_4_1 + y_4_2 + y_4_3 + y_4_4 + y_4_5 + y_4_6 <= 0 
Capacity_5: - 15 x_5 + y_5_1 + y_5_2 + y_5_3 + y_5_4 + y_5_5 + y_5_6 <= 0 

Bounds

Binaries
x_1 x_2 x_3 x_4 x_5 

End

Back to examples browserPrevious exampleNext example