brooksandrew / postman_problems

Graph optimization solvers for the Postman Problems
MIT License
61 stars 32 forks source link

Process directed graphs/edges? #65

Open pbias opened 4 years ago

pbias commented 4 years ago

Hi,

Thanks for providing such useful tool ! I was reading the doc of the project, as well as the issues on github, and I couldn't find any information on working on directed graphs/edges.

Is there a way to use directed edges?

Thanks in advance :)

brooksandrew commented 4 years ago

@pbias - good question. It's currently built for undirected graphs. I can't remember if there was a good reason for this constraint when I first started this project. I think this could be done by swapping NetworkX MultiDiGraph instead MultiGraph (example here). Not sure of all the implications, but I'd be happy to review a PR for this that maintains backwards compatibility to undirected problems, if you're interested.

pbias commented 4 years ago

Thanks for the answer, it is pretty clear ! I think I'll give it a try, if I found anything interesting and not too complicated, I'll submit a pull request with it :) Thanks again !

chris commented 3 years ago

I too am interested in this. I came across this to solve a very similar purpose (trying to cover all trails in a trail network), but in my case, some of the trails are one-way only. @pbias did you take a stab at it? I may take a look if I can, but don't want to repeat the work if someone has already solved it :)