-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
BGL - add CGAL::shortest_path(vs, vt, mesh)
#8724
base: master
Are you sure you want to change the base?
BGL - add CGAL::shortest_path(vs, vt, mesh)
#8724
Conversation
Compilation error here |
What error ? |
|
||
/*! | ||
* \ingroup PkgBGLTraversal | ||
* Computes the shortest path between two vertices in a graph `g` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have to add that the vertices must be in the same connected component
for (auto path_it = path.begin(); path_it != path.end() - 1; ++path_it) | ||
{ | ||
const std::pair<halfedge_descriptor, bool> | ||
h = halfedge((path_it + 1)->vertex, path_it->vertex, g); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we obtain directly the halfedges when running Dijkstra, instead of having a sequence of vertices?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can by implementing a DijkstraVisitor::edge_relaxed(e)
and store the edge in a property map of the target vertex. See the documentation here: vis.edge_relaxed(e, g)
is invoked on edge (u,v)
if d[u] + w(u,v) < d[v]
. The edge (u,v)
that participated in the last relaxation for vertex v
is an edge in the shortest paths tree.
Successfully tested in CGAL-6.1-Ic-84 |
…fter Dijkstra algo
This pull-request was previously marked with the label |
/build:v0 |
The documentation is built. It will be available, after a few minutes, here: https://cgal.github.io/8724/v0/Manual/index.html |
/force-build:v0 |
The documentation is built. It will be available, after a few minutes, here: https://cgal.github.io/8724/v0/Manual/index.html |
/force-build:v0 |
* \cgalParamDescription{a property map associating to each edge in the graph its weight or ``length''. | ||
* The weights must all be non-negative.} | ||
* \cgalParamType{a class model of `ReadablePropertyMap` with `boost::graph_traits<PolygonMesh>::%edge_descriptor` | ||
* as key type and `FT` as value type.} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to introduce FT
. It is probably specified in the BGL what has to be provided for "adding" and "comparing" weights.
The documentation is built. It will be available, after a few minutes, here: https://cgal.github.io/8724/v0/Manual/index.html |
Summary of Changes
computes the shortest path between two vertices, using Dijkstra algorithm
Todo
Release Management