Page 1 of 1

Shortest Path Issue

Posted: Sun May 14, 2023 7:13 am
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 2228 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?

Re: Shortest Path Issue

Posted: Mon May 15, 2023 7:45 am
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