I am searching for an Javascript implementation of the Bron-Kerbosch algorithm or Girvan-Newman algorithm.
Basically I want to color maximal cliques/communities in an undirected graph.
Sadly, I found only cryptic Python and bloated Java & C++ library code. I need it in plain Javascript code (preferable no bloated JS library or JQuery et al dependencies).
// I am using the following data structure
fg_p = []; // Points (Users)
fg_e = []; // Edges
function fgAddUser(uid, name) {
var t_obj = {};
t_obj.id = id;
t_obj.name = name;
fg_g[fg_g.length] = t_obj;
}
function fgAddEdge(a, b) {
var t_obj = {};
t_obj.a = a; // user A
t_obj.b = b; // user B
fg_e[fg_e.length] = t_obj;
}