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

Shortest Path in a Graph - specification incomplete #110

Open
pmarecki opened this issue Sep 23, 2018 · 1 comment
Open

Shortest Path in a Graph - specification incomplete #110

pmarecki opened this issue Sep 23, 2018 · 1 comment

Comments

@pmarecki
Copy link

pmarecki commented Sep 23, 2018

In the problem "Shortest Path in a Graph" it would be advisible to state explicitly:

a) the weights of the edges are necessarily positive,
b) if the graph is directed or not (the class WeightedGraphEdge suggests a directed graph, but it would be good to confirm it; + the "example" does not really present any input data, nor any "arrows" (as for directed graphs), so it remains unspecified),
c) we are not given any info on if the graph is supposed to be connected; even if it is, the statement should specify what should be returned if no path exists between "start" and "target" (if the graph is directed),

These have essential influence on the type of algorithm that can be correctly applied to the problem.

@spolnik
Copy link
Member

spolnik commented Sep 24, 2018

a) yes, they are positive
b) graph is not directed, it's like map where you have connected two cities, but it's weighted
c) it's by design, you get head of graph (WeightedGraph) from where you can find all nodes, which can be connected but not necessarily are

let me know if that helps

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

2 participants