stdgraph / graph-v2

General-purpose C++ graph library
https://stdgraph.github.io/graph-v2/
Boost Software License 1.0
193 stars 20 forks source link

Support for implicit graphs #29

Open milasudril opened 1 year ago

milasudril commented 1 year ago

Also a usecase for Dijkstra: https://github.com/milasudril/cheapest_route. In this case the graph is implicit. In particular, it will use 32 outgoing search directions. Also, it is not interesting to find the cost from the start pixel to every other pixel. You would rather pick a few pairs, and let the algorithm find a natural way connecting the vertices.

If you had to construct a graph using an adjacency list, you will most likely run out of memory. A solution to this is to make it possible somehow return the edges from a customization point, accepting a customized node id. In this case, the node id has to be the coordinates of the pixel. The cost function must be given two node id:s.

Searching the path to every point in the image is both space and time consuming. Thus, there must be a version of Dijkstra that stops at a requested vertex.

lums658 commented 1 year ago

Having an implicit graph is part of the "bring you own graph" functionality that we intend to have for std::graph. Boost.Graph has this capability (see the knight's tour problem in the BGL book and on line https://www.boost.org/doc/libs/1_55_0/libs/graph/example/knights-tour.cpp).

The current interface definition for std::graph should be able to support this.