Modify weight function

8 views
Skip to first unread message

ejel

unread,
Mar 28, 2011, 12:19:12 AM3/28/11
to Graphserver
I'm trying to create a personalized trip planner, which would create
route based on users familiar travel paths. What I need is to modify
the shortest path algorithm to take user familiarity into account (it
would be an edge attribute, similar to distance, etc). This can be
accomplished by adding the attribute to the weight function in
shortest path algorithm.

I've browsing through the source code but still puzzled by the Python
- C code mapping as it is a new area to me. I found that the Djikstra
implementation is
in router.c (gShortestPathTree) but I don't know where the weight
attribute come from and how does it mapped from Python code. I'd
appreciate if anyone can point me to the right direction.

Thanks,
~ejel

Joe Hughes

unread,
Mar 31, 2011, 6:03:43 AM3/31/11
to Graphserver
Very cool, ejel—I look forward to seeing the results. There's been
far too little consideration of users' mental maps of the world in
systems like this so far...

Joe

Nino Walker

unread,
Mar 31, 2011, 2:26:15 PM3/31/11
to graph...@googlegroups.com, Graphserver
The function is streetWalk and and the datastruct is a street edge in the header file. You'll need to add get/sets for your new field, and expose them in python via the gsdll.py file and the core.py. Simply read the other code and follow the pattern.

- Nino

sent from myPhone

> --
> You received this message because you are subscribed to the Google Groups "Graphserver" group.
> To post to this group, send email to graph...@googlegroups.com.
> To unsubscribe from this group, send email to graphserver...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/graphserver?hl=en.
>

e.jel 2.9

unread,
Apr 5, 2011, 5:16:03 PM4/5/11
to graph...@googlegroups.com
Thank you Nino. Your pointer is really helpful; now I'm able to figure out the changes needed.
Reply all
Reply to author
Forward
0 new messages