| | |
weighted graph
Please support our Pascal and Delphi advertiser: Programming Forums - DaniWeb Sister Site
![]() |
Ah, a 1D list. OK.
If you are at liberty to create your own input file, I suggest you make it something easy to read (programmatically), like:
where the first number on the line is the node number, the second is its weight, and any remaining are edges leaving the node. (You don't actually have to list the node number, you could just deduce it from the line number as you read...)
Make yourself a record that represents a node. Then use an array of that record type. All you have to do then is read one line at a time into one node at a time.
Hope this helps.
If you are at liberty to create your own input file, I suggest you make it something easy to read (programmatically), like:
Pascal and Delphi Syntax (Toggle Plain Text)
0 12 0 2 1 24 0 2 2 13 1
Make yourself a record that represents a node. Then use an array of that record type. All you have to do then is read one line at a time into one node at a time.
Hope this helps.
![]() |
Similar Threads
- Help with Idea?!? (Java)
- Discrete Math (Geeks' Lounge)
- Finding path in a graph using linked list (C)
- Dijkstra's alogirthm & Shortest path problems (Computer Science)
- Traveling Salesman Problem ... question about Triangle Inequality (Computer Science)
- weighted graph (Computer Science)
Other Threads in the Pascal and Delphi Forum
- Previous Thread: Help needed on pascal assignment?
- Next Thread: 7 seg
| Thread Tools | Search this Thread |






