0

I was given a problem that in a connected, weighted graph G = (N, A), find a connected subgraph G_s = (N_s, A_s), where |N_s| <= l and A_s = {(i, j): i \in N_s, j \in N_s, (i, j) \in A}, such that the distance between any pair of nodes in G_s is mo more than a positive number, say k.

My initial thought is running dijkstra's algorithm for every node in G, remove the nodes that k hops from the node, and re-run dijkstra's algorithm for every nodes within the k-hops of the root node, but this seems not working in the sense that the distance here I use for calculation is the distance in G, not in G_s, which is the shortest distance between any pair of nodes in the subgraph G_s (i.e., the shortest path can not use the nodes that are outside of G_s).

Anyone has some thoughts on this problem, I thank and appreciate help in any form.

3
  • Looks like a variation of a clique problem. Commented Apr 1, 2024 at 3:31
  • With no additional constraints, this could be trivially solved by returning the empty graph, or a single node, or the subgraph induces by the set of nodes <= k/2 distance from any arbitrary node. Do you have additional constraints? E.g., are you trying to find the largest such subgraph? Commented Apr 1, 2024 at 12:43
  • Thank both of you for the comments and inspirations, the problem is stated as the distance-k clique problem, a variant of the clique problem. Commented Apr 3, 2024 at 23:59

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.