1
$\begingroup$

I am working on an application that needs to connect $n$ disconnected nodes, where each node can have at most $m$ edges, such that when traveling from the $ith$ node in graph to the $jth$ node, the highest number of edges covered is minimum and mapping cost is also minimum.


For example: If $n=5$ and $m=3$, there are 2 possible graphs that are the solution

enter image description here

In both the graphs, the longest path from one node to another is of length 2


For example: If $n=6$ and $m=3$, there are 2 possible graphs that are the solution (and I've added one more, to show the incorrect graph)

enter image description here

In all three graphs, the longest path from one node to another is of length 2. However, if you were to add up the number of edges traveled, you'd get 22, but the graphs on left and right add up to 21, i.e., even though the longest distance between 2 nodes is of 2 edges, the total cost of mapping the graph is more than the optimal solution.

(mapping cost = sum of distances between nodes $a-b, a-c...a-f, b-c, b-d...b-f$ and so on till $e-f$)


I'd like to know if there is a way to create such a graph layout mathematically (or programmatically) for givel values of $n$ and $m$, because drawing graphs by hand and testing is impossible?

$\endgroup$
  • $\begingroup$ Did you have a question? $\endgroup$ – Perry Elliott-Iverson Oct 30 '15 at 15:44
  • $\begingroup$ question updated. I'd like to know if there is a way to create such a graph layout mathematically (or programmatically) for givel values of nn and mm, because drawing graphs by hand and testing is impossible? $\endgroup$ – zhirzh Oct 30 '15 at 15:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.