-
Notifications
You must be signed in to change notification settings - Fork 81
How to process dijkstra shortest path parents that return #undef? #140
Comments
Well, you can use |
I'd like some consistent way - right now it's two checks that cover strings and ints, but I don't have a ton of confidence that I've caught edge cases. The other case where I'm seeing what appears to be uninitialized array values (see |
I think @mlubin's suggestion of using |
Is |
yes |
Or we can just use a simple bool array to indicate if a parent has been set or not. |
Yeah, I was thinking the same thing, at least for older versions of Julia |
This may be a more general Julia question, but I'm at a loss as to how to treat something like this:
How do I test for this
#undef
in code?Also, more of an enhancement request, I guess - is there ANY way to get Graphs to return something consistent when a node is not reachable? That is, strings return
#undef
, ints return either some very large number or0
(not sure why):and I'm not quite sure how to test for all these cases other than checking to see whether the value is in
graph.vertices
, which apparently fails withERROR: access to undefined reference
if the value is#undef
...The text was updated successfully, but these errors were encountered: