Question
In essence you need to implement the following method in Java. It takes 2 lists: A and B, one index which is -1 initially, k
In essence you need to implement the following method in Java. It takes 2 lists: A and B, one index which is -1 initially, k is a positive integer. Bool CLIQUE(A, B, index, k) Begin If A contains k vertices and these vertices creates a clique then return yes index is increased such that index is minimum and B[index] is neighbor to all vertices of A If such B[index] does not exist return no If (sizeof(A) + (n-index)) less than k return no Let A be a deep copy of A by dynamic allocation Insert B[index] in A Bool firstPart = CLIQUE(A, B, index,k) Delete A If firstPart == yes return yes secondPart = CLIQUE(A, B, index,k) If secondPart == yes return yes Return no End The above project can be called with the value of k from 1 to n, where n is the number of vertices in the graph. Let the algorithm return "no" for k = m, then the max clique size of the graph is m-1. In addition to java code to solve this problem, you have to write a report.
Your report contains the following. An example of a graph. The adjacency matrix that represent the graph. Your graph should contain at least 10 vertices and 25 edges. Let the max clique size of your graph is m-1. Describe the recursive tree from your code for k = m. Describe the complexity of the algorithm CLIQUE by some recursive relations. How do you solve this recurrence relation? (bonus question)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started