<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Hi Wesam<br>
<br>
> What is the fastest/most effecient way to attach a new
attribute to a specific node in Graphhopper.<br>
<br>
I assume you need a very fast way to fetch this information on the
fly while the algorithm is running (?)<br>
<br>
Then still this depends on the data and the algorithm you use. I
would use a bitset, a (trove) HashMap/Set or an array. Or if
persistence is needed a DataAccess object. This depends on how
sparse the data is, as a primitive or Object array can be very
large but e.g. a HashMap requires storing the keys, potential
resizing, has a bit slower access and has roughly 30% or more
empty space.<br>
<br>
And also if you use A* then you access the node its lat,lon values
stored in the nodes DataAccess object, then it will be faster to
expand the internal 'nodes' array, as such closely stored values
are better cacheable from the CPU. You can store currently only
one int value there, but only if no turn restrictions are used
(will be improved later of course)<br>
<br>
BTW: Please see <a href="https://discuss.graphhopper.com/">here</a>
our new discussion board (<a
href="https://discuss.graphhopper.com/t/moving-mailing-list-to-discuss-graphhopper-com/42">here</a>
is the reason). And I would like to ask you to create a new topic
there instead of replying here.<br>
<br>
Kind Regards,<br>
Peter<br>
<br>
On 16.09.2015 09:08, wesam Herbawi wrote:<br>
</div>
<blockquote
cite="mid:CALqm3gBB1ogiOkWrf2avpD32LZ6EXZZ2FD0T+2==Ovjr5U9WBg@mail.gmail.com"
type="cite">
<div dir="ltr">What is the fastest/most effecient way to attach a
new attribute to a specific node in Graphhopper. I was thinking
of own nodes array or hashtable (as only subset of these nodes
might be assigned the new attribute). I hope that there is
another possibility provided by Graphhopper.
<div><br>
</div>
<div>Regards,</div>
<div>Wesam</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
GraphHopper mailing list
<a class="moz-txt-link-abbreviated" href="mailto:GraphHopper@openstreetmap.org">GraphHopper@openstreetmap.org</a>
<a class="moz-txt-link-freetext" href="https://lists.openstreetmap.org/listinfo/graphhopper">https://lists.openstreetmap.org/listinfo/graphhopper</a>
</pre>
</blockquote>
<br>
</body>
</html>