Question: Here is the c++ code can you fix it it must work with inputs 5 and 4 output=2 WE CANT SEE THE OUTPUT #include using
Here is the c++ code can you fix it it must work with inputs 5 and 4 output=2 WE CANT SEE THE OUTPUT
#includeusing namespace std; int hammingDistance(vector v, vector w) { int distance = 0; for (int i = 0; i >& graph, vector & R, vector & P, vector & X) { // Base case: if P and X are both empty, we have found a maximal clique if (P.empty() && X.empty()) { // Print the clique for (int i : R) { cout P1, X1; for (int i : P) { if (hammingDistance(graph[pivot], graph[i]) >= d) { P1.push_back(i); } } for (int i : X) { if (hammingDistance(graph[pivot], graph[i]) >= d) { X1.push_back(i); } } for (int v : P1) { vector R1 = R; R1.push_back(v); vector P2, X2; for (int i : P) { if (hammingDistance(graph[v], graph[i]) >= d) { P2.push_back(i); } } for (int i : X) { if (hammingDistance(graph[v], graph[i]) >= d) { X2.push_back(i); } } maximalClique(graph, R1, P2, X2); vector ::iterator it = find(P.begin(), P.end(), v); P.erase(it); X.push_back(v); } } int main() { int n, d; cin >> n >> d; vector > graph; for (int i = 0; i vertex; for (int j = 0; j > bit; vertex.push_back(bit); } graph.push_back(vertex); } vector P, X, R; }
WE CANNOT SEE THE OUTPUT IT MUST WORK WITH INPUTS=5 4 AND OUTPUT SHOULD BE 2 ACCORDING TO THESE INPUTS !!!!!!
(w1,..., wn) is the number of indices k such that vk!=wk A fundamental question in coding theory is to determine the number the maximal number of binary vectors of length n that one can find such that any two distinct vectors have a Hamming distance >=d. For example, A(5,4)=2 The with the size of a maximal clique in H(n,d). Find an implement "efficient" algorithms to compute the maximal clique in the Hamming graph (but note that the problem to compute maximal cliques is NP-hard). Note that, due to the NP-hard problem, your solution can be exact, approximate, or heuristic. imitation: You can only use C++ or Java language in your project
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
