Search for N nodes in a graph with maximum spread / distance from another

Given a graph with N nodes (in thousands), I need to find the K nodes so that the average path length between each pair (K1, K2) K is maximized. So basically I want to place them as far away from each other as possible.

What algorithm would I use for this / how could I program this without trying several separate K combinations?

Also, as an extension: if now I have N nodes, and I need to place in the column 2 groups of nodes K and L, so that the average path length between each pair (L, K) is maximized, how would I do this?

My current attempt is to simply make a few random placements and then calculate the average path length between the K and L pairs, but this calculation starts to take a lot of time, so I would rather not spend a lot of time simply evaluating randomly selected combinations. I would rather spend time getting the REAL most spread combination.

Are there any algorithms for this?

+4
source share
1 answer

The bad news is that this problem is NP-hard, by shortening from Independent Set. (Assume the weight is one. Add a new vertex associated with all the other vertices, then we are looking for a collection K that has an average distance of 2.)

( , ), , node is/is not a of K as ( K, , , , - w631 > ).

node , , ( , FPC), , .

+4

Source: https://habr.com/ru/post/1584246/


All Articles