Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dijkstra:88: attempt to index local 'e' (a number value) #4

Open
DavidSheh opened this issue Oct 17, 2019 · 0 comments
Open

Dijkstra:88: attempt to index local 'e' (a number value) #4

DavidSheh opened this issue Oct 17, 2019 · 0 comments

Comments

@DavidSheh
Copy link

local g = require('luagraphs.data.graph').create(8); -- undirected weighted graph

g:addEdge(5, 4, 72)
g:addEdge(9, 8, 73)
g:addEdge(11, 12, 66)
g:addEdge(22, 11, 48)
g:addEdge(20, 19, 34)
g:addEdge(6, 5, 56)
g:addEdge(4, 3, 76)
g:addEdge(21, 6, 18)
g:addEdge(13, 17, 47)
g:addEdge(21, 20, 37)
g:addEdge(9, 10, 61)
g:addEdge(21, 22, 102)
g:addEdge(10, 11, 65)
g:addEdge(2, 3, 85)
g:addEdge(7, 6, 82)
g:addEdge(15, 16, 43)
g:addEdge(2, 1, 74)
g:addEdge(14, 1, 48)
g:addEdge(18, 17, 71)
g:addEdge(15, 14, 47)
g:addEdge(7, 8, 71)
g:addEdge(19, 4, 121)
g:addEdge(19, 16, 61)
g:addEdge(19, 18, 64)
g:addEdge(12, 13, 24)

local source = 6
local dijkstra = require('luagraphs.shortest_paths.Dijkstra').create()
dijkstra:run(g, source) -- source is the id of the source node in the path search
local path = dijkstra:getPathTo(10)

Use the above test data to report an error。error message is :

Dijkstra:88: attempt to index local 'e' (a number value)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant