How to read a Adjacecny list from a text file

4 views
Skip to first unread message

Hossein Dashti

unread,
Apr 19, 2017, 6:41:34 PM4/19/17
to AMPL Modeling Language
I was wondering how can I read a data file in AMPL where number of rows is known nut number of elements per rows are dynamic and changes per row?
Say, I want to read following adjacency list:
1 2 4
1 5
4 8 9 12
1 3
 

Robert Fourer

unread,
Apr 20, 2017, 10:40:48 AM4/20/17
to am...@googlegroups.com
It depends on how the data is defined in your AMPL model. If you can show the AMPL set and param statements that you want to use for this data, then it should be possible to give a specific suggestion for reading this file.

Bob Fourer
am...@googlegroups.com

=======
Reply all
Reply to author
Forward
0 new messages