how do i create a network / graph from nodes and lines?
4 views (last 30 days)
Show older comments
Hi,
I am trying to make a logistic simulator and want to create a node/line network from a travelmap. The image displays the routes on the map whichhave different gray scales for different travelling speeds.
I used the help from "image analyst" (tx!) do extract nodes and labelled paths:
- extract skeleton from image, converted to 1/0 binary (Black/White) matrix
- extract branchpoints
- extract line segments using dilated branchpoints
- label line segments
bwSkel = bwmorph(binaryImage, 'skel', inf);
bp = bwmorph(bwSkel, 'branchpoints');
bI = bwSkel & ~bwmorph(bp,'dilate');
labeledImage = bwlabel(bI);
I got this:
How do I create a node-network/graph from the branchpoints and linesegments which will allow me to use algo's like travelling salesman problem?
I want the salesman to travel from A to B constrained so that he has to visit one of a selected set of nodes (hubs) before continuing his journey to the endpoint. He may have multiple endpoints which he has to visit.
0 Comments
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!