graph - How to find a path from source to destination by adding edges with minimum total weight -
i have 100 atoms in 3-d space. each atom node. edges added between 2 nodes when closer 0.32 nm weight equals distance. want find path source node destination node. since 100 atoms not connected, can't find path.
what want add 1 or more edges make source , destination connected. meanwhile, want minimize total weights of new added edges. again, weight calculated 2 nodes' distance.
it kind of reverse problem of minimum cut. there algorithm helps this?
thanks lot!
it seems 1 way make use of graph search algorithm finding shortest path, dijkstra's algorithm, , perhaps work both ends (source , destination).
the difference can't know if edge exists or not, , creating graph go. if start @ a, , nodes of graph a, b, c, d, e. need check if a-b, a-c, a-d, , a-e exists. if a-b exists, check b-c, b-d, , b-e.
this o(|v|^2), depend on how many edges explored.
the same idea applies if interested in adding edges longer 0.32 nm. it's path length calculation changes. edges less .32 nm zero-length, or lot shorter (as become less important). if last bit doesn't work, gets bit trickier.
Comments
Post a Comment