230 likes | 366 Views
This document presents an introduction to Integer Programming using AMPL (A Mathematical Programming Language). It focuses on solving the GT Railroad problem, detailing the steps to input data, set up the model, and execute the optimization. It includes model files and data sets necessary for implementation. Readers will learn to utilize AMPL, edit data files, interpret results, and find optimal solutions. Whether you are a beginner or looking to refresh your knowledge of AMPL, this guide provides practical insights into effective transportation modeling.
E N D
EMIS 8373: Integer Programming Introduction to AMPL updated 10 January 2006
h f O T i i t e s e o o r g n s h f d D T i i t t t e s e o e s n a o n s X i b f l b l i i i i i t t m n c x a n u m e r o u n s a v a a e a o r g n i j i j i b f d d i i i i j t t t t O D i j 2 2 r n u m e r o u n s r e q u r e a e s n a o n j ; h f h f d i i i i i i i i j t t t t t t X c e c o s o s p p n g o n e e m r o m o r g n o e s n a o n i j b 8 O j i · t t 2 s u e c o x a i j i h b f h d f d i i i i i i i j t t t t t x e n u m e r o u n s s p p e r o m o r g n o e s n a o n i j D j 2 X 8 D j ¸ 2 x r i j j O i 2 8 O D i j 0 ¸ 2 2 x i j ; A General Transportation Model
transport_model.txt set O; set D; param a {i in O}; param r {j in D}; param c {i in O, j in D}; var x {i in O, j in D} >= 0; minimize cost: sum {i in O, j in D} c[i,j] * x[i,j]; subject to supply {i in O}: sum {j in D} x[i,j] <= a[i]; subject to demand {j in D}: sum {i in O} x[i,j] >= r[j];
GT_data.txt set O := IE_Junction, Centerville, Wayover_City; set D := A_Station, Fine_Place, Goodville, Somewhere_Street; # supply param a := IE_Junction 4 Centerville 1 Wayover_City 2; # demand param r := A_Station 1 Fine_Place 1 Goodville 1 Somewhere_Street 1;
GT_data.txt param c : A_Station Fine_Place Goodville Somewhere_Street := IE_Junction 13 35 42 9 Centerville 6 61 18 30 Wayover_City 15 10 5 9 ;
Edited GT_data.txt set O := IE_Junction, Centerville, Wayover_City; set D := A_Station, Fine_Place, Goodville, Somewhere_Street; # supply param a := IE_Junction 3 Centerville 3 Wayover_City 3; # demand param r := A_Station 2 Fine_Place 2 Goodville 2 Somewhere_Street 2;
Using AMPL Student Edition on Windows • Download AMPL Student Edition • Download model and data file from Blackboard • transport_model.txt • GT_data.txt • Save the files in the amplcml directory created in step 1 • Double click on the AMPL icon to start AMPL
Viewing the Results • Quit AMPL • Open results.txt with WordPad or Word