how do i create a network / graph from nodes and lines?
이전 댓글 표시
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개)
카테고리
도움말 센터 및 File Exchange에서 Nearest Neighbors에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!