algorithm - Making a fully connected graph using a distance metric -
say have series of several thousand nodes. each pair of nodes have distance metric. distance metric physical distance ( x,y coordinates every node ) or other things make nodes similar.
each node can connect n other nodes, n small - 6.
how can construct graph connected ( e.g. can travel between 2 nodes following graph edges ) while minimizing total distance between graph nodes.
that don't want graph total distance traversal minimized, node total distance of links node minimized.
i don't need absolute minimum - think np complete - relatively efficient method of getting graph close true absolute minimum.
i'd suggest greedy heuristic select edges until vertices have 6 neighbors. example, start minimum spanning tree. then, random pairs of vertices, find shortest path between them uses @ 1 of unselected edges (using dijkstra's algorithm on 2 copies of graph selected edges, connected unselected edges). select edge yielded in total largest decrease of distance.
Comments
Post a Comment