0

I need an algorithm to find k-size subgraphs of a large graph. What is your suggestion?

Note: My graph is undirected.

Thanks in advance.

phs
  • 10,687
  • 4
  • 58
  • 84
iremce
  • 570
  • 4
  • 14
  • 25

2 Answers2

0

If you pick any k vertexes from a large graph you can make a sub-graph by selecting only those vertexes and the edges connecting them, if any.

If you want your k vertexes to be connected, you could pick k connected vertexes from a connected component of the large graph - see http://en.wikipedia.org/wiki/Connected_component_%28graph_theory%29

If you actually want k vertexes such that each vertex has an edge linking it to each of the other k-1 vertexes, then you need to know that this is called a clique, and finding this is a hard problem - see http://en.wikipedia.org/wiki/Clique_%28graph_theory%29

mcdowella
  • 19,301
  • 2
  • 19
  • 25
  • Hi, my problem is a click problem. I would like to learn it's clear solution because I need it's implementation. – iremce Jun 17 '12 at 15:52
0

A very simple way to do this is to perform a BFS or a DFS for K iteration.

Mark
  • 1,100
  • 9
  • 17