Shortest Path Issue Topic is solved

Problems with modeling
Post Reply
bw0717
User
User
Posts: 5
Joined: 1 year ago

Shortest Path Issue

Post by bw0717 »

I want to find the shortest path from point A to point G
No repetition, no turning back
image.png
image.png (9.23 KiB) Viewed 2146 times

Code: Select all

	A	B	C	D	E	F	G
A		8	6				
B				5	10		
C				6		9	
D							10
E							7
F							11
G							
or

Code: Select all

A.B	8
A.C	6
B.D	5
B.E	10
C.D	6
C.F	9
D.G	10
E.G	7
F.G	11
I don't know how to write variables and equations.
Can anyone provide me with a sample?
User avatar
bussieck
Moderator
Moderator
Posts: 1033
Joined: 7 years ago

Re: Shortest Path Issue

Post by bussieck »

The GAMS Lib model lop (https://www.gams.com/latest/gamslib_ml/ ... b_lop.html) and sroute (https://www.gams.com/latest/gamslib_ml/ ... route.html) determine the shortest path from all nodes to all other nodes.

-Michael
Post Reply