[GRASS-dev] [GRASS GIS] #584: vector directed graph library BUG2

#584: vector directed graph library BUG2
---------------------------------------+------------------------------------
Reporter: mmetz | Owner: grass-dev@lists.osgeo.org
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Vector | Version: svn-develbranch6
Keywords: shortest path, edge costs | Platform: Unspecified
      Cpu: Unspecified |
---------------------------------------+------------------------------------
See https://trac.osgeo.org/grass/browser/grass/trunk/lib/vector/dglib/BUGS

BUG2 (24.2.2003):

If 2 nodes are connected by more arcs, SP doesn't return the shortest
one but the last arc (between these two nodes) inserted to graph.

Possible solution

When building a graph and adding a new edge, check if there is already an
edge connecting the two nodes. If the cost of the edge to be inserted is
lower than the current cost connecting these two nodes, replace old edge,
else don't add the new edge.

This could be done in
https://trac.osgeo.org/grass/browser/grass/trunk/lib/vector/Vlib/net.c

Just an idea, needs testing.

Markus M

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/584&gt;
GRASS GIS <http://grass.osgeo.org>

#584: vector directed graph library BUG2
--------------------------+-------------------------------------------------
  Reporter: mmetz | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: normal | Milestone: 7.0.0
Component: Vector | Version: svn-develbranch6
Resolution: | Keywords: shortest path, edge costs
  Platform: Unspecified | Cpu: Unspecified
--------------------------+-------------------------------------------------
Comment (by hamish):

sounds reasonable, but it's so obvious it makes me wonder why it wasn't
done the first time.

H

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/584#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>

#584: vector directed graph library BUG2
--------------------------+-------------------------------------------------
  Reporter: mmetz | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: normal | Milestone: 7.0.0
Component: Vector | Version: svn-develbranch6
Resolution: | Keywords: shortest path, edge costs
  Platform: Unspecified | Cpu: Unspecified
--------------------------+-------------------------------------------------
Comment (by mmetz):

Replying to [comment:1 hamish]:
> sounds reasonable, but it's so obvious it makes me wonder why it wasn't
done the first time.
>
I agree, but both the directed graph library and the Vect_net_*()
functions look quite polished to me, maybe it's not that easy. Updating
the database with costs could be difficult. I will not get to testing it
in the next few weeks, maybe Daniel Bundala can look into it when he
starts working on his GSoC project. In any case, it's a bug and should be
addressed, and here in trac it is a bit more prominent than in the BUGS
file hidden in lib/vector/dglib.

Markus M

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/584#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>

#584: vector directed graph library BUG2
---------------------------------------+------------------------------------
Reporter: mmetz | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Vector | Version: svn-develbranch6
Keywords: shortest path, edge costs | Platform: Unspecified
      Cpu: Unspecified |
---------------------------------------+------------------------------------

Comment(by mmetz):

I did some testing and found out that

  * I could only reproduce BUG2 with cache enabled
  * BUG2 occurred only if the path to the node closer to start was
requested first
  * BUG2 occurred only if the distance or cumulative cost was requested and
not the actual path

BUG2 is now fixed in trunk and devbr6, at least I can no longer reproduce
it, but maybe I have overlooked some special case.

Markus M

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/584#comment:3&gt;
GRASS GIS <http://grass.osgeo.org>

#584: vector directed graph library BUG2
---------------------------------------+------------------------------------
Reporter: mmetz | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Vector | Version: svn-develbranch6
Keywords: shortest path, edge costs | Platform: Unspecified
      Cpu: Unspecified |
---------------------------------------+------------------------------------

Comment(by neteler):

Can this report be closed?

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/584#comment:4&gt;
GRASS GIS <http://grass.osgeo.org>