From A Lookup Grid to Database
Posted: Thu Jun 11, 2009 1:58 pm
I have the following table
Think of this similar to the travelling salesman with point to point, although the algorithm isn't complicated. More like a lookup from A->B
What would be the best way to store in a database, since the time is the same both directions. A to B is 2, and B to A is 2
Doing this seems like it will be duplicating all the data which wouldn't be a good design.
Any thoughts which would be the best way implement this?
Code: Select all
x A B C D
A 0 2 1 1
B 2 0 1 1
C 1 1 0 1
D 1 1 1 0
What would be the best way to store in a database, since the time is the same both directions. A to B is 2, and B to A is 2
Code: Select all
Start End Time
A B 2
A C 1
B A 2
etc
Any thoughts which would be the best way implement this?