RelaxedKmeans

RelaxedKmeans module

class markovianSBM.RelaxedKmeans.RelaxedKmeans[source]

Bases: object

Class solving the Semi Definite Program which is a relaxed version of the K means problem.

compute_costs()[source]

Show the value of the objective function of the SDP with the matrix $B^*$ which is the solution of the K means problem and with $hat{B}$ which is the optimal solution of the SDP.

solve_relaxed_SDP()[source]

Solve the Semi Deifnite Program and save the optimal solution.

visualize_B_matrices()[source]

Method providing a vizualisation of the matrices $B^*$ (optimal solution of the K-means problem) and $hat{B}$ optimal solution of the SDP relaxation. This allows to easily see if a final rounding step on the rows of $hat{B}$ could allow to reach a relevant clustering of the nodes of the graph.