[GraphHopper] can I add nodes and edges to the graph on the fly?
graphhopper newbie
graphhopper.newbie at gmail.com
Thu Jul 23 16:52:28 UTC 2015
If I correctly understand you, this would solve the problem of adding
vehicle representative nodes. So during the time of creating the street
graph, the vehicles' nodes will be considered and have their own indecies
in the original nodes array. However, what I miss is how to maintain the
dynamic edges. when a vehicle is parked somewhere, an edge has to be added
to connect it to the closest street node and the previous connecting edges
have to be removed.
Another interpretation that might be what you mean is that not to add
vehicle nodes at all and consider the closest original street node to the
vehicle to be the vehicle representative node and to add it to the data
structure you mentioned earlier. if this is the case then I would miss some
information I was planning to model using the edge connecting the street
node and the vehicle node (still can be done implicitly)
sorry for the long discussion. just trying to understand the alternatives
before going further.
Regards
On 23 July 2015 at 16:58, Peter <graphhopper at gmx.de> wrote:
> I would just mark (in a different data structure) that these nodes are
> special e.g. in an array or (RAM)DataAccess which is more complex but also
> storable and scales to GB.
>
> This way you don't need to remove/re-add them and instead can just remove
> the marker from the array. A lot easier IMO.
>
> Regards,
> Peter
>
> On 23.07.2015 16:17, graphhopper newbie wrote:
>
> Thanks for the reply,
> The use case makes the situation dynamic. Assume that you have free
> floating carsharing vehicles. Let us assume that these vehicles can be
> parked everywehere. what I wanted to do is to periodically link these
> vehicles to the closest nodes in the original street graph (remove old
> links when vehicles change their positions). This way the vehicles will be
> represented as nodes in the graph and routing will be easier later. My
> routing algorithm has to be able to switch from walk to drive mode when
> such vehicle node is found. the goal is to have walk-drive-walk route in
> one Dijkstra run.
>
> Regards,
>
> On 23 July 2015 at 15:47, Peter <graphhopper at gmx.de> wrote:
>
>> Hi,
>>
>> you can, but there is currently no way to remove such edges (efficiently).
>>
>> Another workaround would be to use the QueryGraph for this like we use to
>> introduce virtual nodes and edges to incorporate the start+end GPS point
>> into the graph. But never tried this.
>>
>> Why not always add all such points to the graph, why is a dynamic
>> scenario needed here?
>>
>> Kind Regards,
>> Peter
>>
>>
>> On 23.07.2015 15:42, graphhopper newbie wrote:
>>
>> Hi everybody,
>> I am wondering if I can add nodes and edges to the graph after its
>> creation in a dynamic way. I need this functionality to deal with dynamic
>> scenarios like representing available bikesharing/carsharing points which
>> changes often. The simpist case I need is to add an edge from a newly added
>> node ( representing the available bike) to the closest node in the graph
>> and the reverse edge. i.e. from the closest node to the the bike node.
>>
>> Thank you very much,
>>
>>
>
> _______________________________________________
> GraphHopper mailing list
> GraphHopper at openstreetmap.org
> https://lists.openstreetmap.org/listinfo/graphhopper
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/graphhopper/attachments/20150723/5b377307/attachment.html>
More information about the GraphHopper
mailing list