Skip to content

Starting edge on Chinesse Postman problem #1119

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
cvvergara opened this issue Oct 11, 2018 · 0 comments
Open

Starting edge on Chinesse Postman problem #1119

cvvergara opened this issue Oct 11, 2018 · 0 comments
Assignees
Labels
ChPP Chinese Postman Problem Discussion

Comments

@cvvergara
Copy link
Member

@XJTUmg

Is it possible to add to the Chinese postman problem a start_eid (start edge id) so that the first line of the result is that edge?

SELECT * FROM pgr_directedChPP(
    'SELECT id,
     source, target,
     cost, reverse_cost FROM edge_table where id < 17'
);
 seq | node | edge | cost | agg_cost
-----+------+------+------+----------
   1 |    4 |    3 |    1 |        0
   2 |    3 |    2 |    1 |        1
   3 |    2 |    1 |    1 |        2
   4 |    1 |    1 |    1 |        3
etc

have

SELECT * FROM pgr_directedChPP(
    'SELECT id,
     source, target,
     cost, reverse_cost FROM edge_table where id < 17',
    2 -- the first edge to be on the list is edge 2
);
 seq | node | edge | cost | agg_cost
-----+------+------+------+----------
   1 |    3 |    2 |    1 |        1
   2 |    2 |    1 |    1 |        2
   3 |    1 |    1 |    1 |        3
etc
@cvvergara cvvergara added Discussion ChPP Chinese Postman Problem labels Oct 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ChPP Chinese Postman Problem Discussion
Projects
None yet
Development

No branches or pull requests

2 participants