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.
![2
3](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F665e8a25-483e-405b-bcc4-d50174e3a6a3%2F330d3212-9191-4457-8b11-627320647e39%2F9532b4e_processed.jpeg&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Step by step
Solved in 2 steps with 1 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)