Skip to content

Instantly share code, notes, and snippets.

View WinstonCampeau's full-sized avatar

Winston Campeau WinstonCampeau

View GitHub Profile
@WinstonCampeau
WinstonCampeau / gist:a8cffe043e718e09c11a197eeff0ba8f
Last active July 27, 2018 04:41
SageMath - Maximum Biclique, Maximum Weighted Biclique, Maximum Densest Biclique
#The following code finds the maximum biclique in bipartite graphs. (Note: Not effecient for large bigraphs, but great for multiple small)
#Generates a dictionary containing the sets of neighbors for each vertex in a bipartition (in this case the right bipartition)
for K in some_list_of_bipartite_graphs_you_generate:
neighbor_sets={}
for vertex in K.bipartition()[1]:
neighbor_sets[vertex]=set(K.neighbors(vertex))