Opened 16 years ago
Last modified 15 years ago
#151 new enhancement
Possible improvement in the function-type implementation of BFS/DFS/Dijkstra
Reported by: | Peter Kovacs | Owned by: | Balazs Dezso |
---|---|---|---|
Priority: | minor | Milestone: | |
Component: | core | Version: | hg main |
Keywords: | Cc: | ||
Revision id: |
Description
This ticket is a follow-up of #96.
Maybe it would be better if we could avoid using NodeMap
s (instead of NullMap
s) as PredMap
and DistMap
structures in the cases when they are not necessary. So the default type of these maps would be a NullMap
in Bfs/Dfs/DijkstraWizardDefaultTraits
classes, and it would be changed only if it is really needed (i.e. path()
and/or dist()
named parameter is used).
Balazs suggested a solution for this, saying: "iff at least one s-t path search is queried, real pred map should be defined, and iff at least one length of an s-t path queried, real dist map should be used. It could be done with the ForkMap
s".
It is a benchmark question however, that this implementation would be more efficient or not in practice.
Attachments (1)
Change History (3)
comment:1 Changed 16 years ago by
Milestone: | LEMON 1.1 release |
---|
Changed 15 years ago by
Attachment: | function-interfaces.diff added |
---|
The attached patch file shows a possible solution for this task (using run time check inside the
run()
functions). Note that it modifies only one function, the others could be implemented similarly. It would cause a lot of code repeating.