data (#23) - Strange behaviour with reverse cost - all algorithm (#371) - Message List

Strange behaviour with reverse cost - all algorithm

Hello,

I have been willing to test pgrouting in order to see how I can use it. I have a directed network, so I am willing to use directed algorithm (in fact, I would like especially to make the Shooting * run properly). But the algorithms really behave in an odd way. I have done a couple of test :

Everything run on windows XP. I used two dataset : one from Jean David Techer's website ( http://www.davidgis.fr/documentation/pgrouting-1.02). The link shows what behavior is expected from pgrouting. Using Postgresql 8.3 and pgrouting 1.02, I manage to make the many algorithms run successfully, but not with my data. Howerver, the table structure of the table containing my network is exactly the same, and the query I used are exactly the same. Here is the structure of the data in my table :

CREATE TABLE test1
(
  gid serial NOT NULL,
  oneway character varying(254),
  the_geom geometry,
  id integer,
  source integer,
  target integer,
  "cost" double precision,
  reverse_cost double precision,
  x1 double precision,
  y1 double precision,
  x2 double precision,
  y2 double precision,
  length double precision,
  "rule" text,
  to_cost double precision,
  my_oneway character varying(254),
  CONSTRAINT test1_pkey PRIMARY KEY (gid),
  CONSTRAINT enforce_dims_the_geom CHECK (st_ndims(the_geom) = 2),
  CONSTRAINT enforce_geotype_the_geom CHECK (geometrytype(the_geom) = 'MULTILINESTRING'::text OR the_geom IS NULL),
  CONSTRAINT enforce_srid_the_geom CHECK (st_srid(the_geom) = 3978)
)

id always = gid. The cost are set to -1 for the oneway value (cost or reverse cost). For exemple :

In my queries I always use the two parameters directed and use reverse cost to true.

-- Shooting *

SELECT * FROM shortest_path_shooting_star (

'SELECT id, source, target, cost,reverse_cost, x1, y1, x2, y2, rule, to_cost FROM test1 ORDER BY id',56,15,true,true

) ;

I compute two routes between two points, and my routes typically uses the same segments, whereas some of them are either cost or reverse_cost equals to -1.

Strange fact, if I change the value of the field cost on a segments that is used in my route and has reverse_cost SET to -1 (so blocked in just on way), both route will change in the same way (for point 1 to point 2 and from point 2 to point 1) .

Does someone already run into that issue? It seems so according to the thread in the forum Shooting *, but I am going crazy trying to find a logic explanation for that. What does the data need to work that I didn't take into account. Is that some bug of PGRouting? I am quite new with this tool.

I feel frustrated, because I have the feeling that it is a very nice tool, but so far I come to a point where I am wondering if it is a problem linked to my data of a pgrouting issue.

Does someone have an hint of where to look?

Regards