You have a graph G = , |V| = n and |E| = m (represented using adjacency matrix you can). Given such a graph and a number k (k <= n). In this graph, a number of k nodes which finds the existence of the subgraph (whether all the elements of k nodes are connected to each other). Develop a brute-force algorithm and write its code in java language
You have a graph G = <V, E>, |V| = n and |E| = m (represented using adjacency matrix you can). Given such a graph and a number k (k <= n). In this graph, a number of k nodes which finds the existence of the subgraph (whether all the elements of k nodes are connected to each other). Develop a brute-force
For example, the graph below is given and your program should send "true" when k = 3 or 4. K = 5 or more your algorithm should send "false" when a large number is entered. Note: No. 2,3,4 and 6 The nodes are all connected to each other. Whichever 3 of these four you take, they all depend on each other. you find a subgraph. This is the case with 4,5 and 6.
Step by step
Solved in 2 steps with 1 images