def BipartiteGraphWithoutOverlapsModel(): builder = BipartitniModelBuilder((60, 40)) builder.addCommunityA(range(20)) builder.addCommunityA(range(20, 40)) builder.addCommunityA(range(40, 60)) builder.addCommunityB(range(20)) builder.addCommunityB(range(20, 40)) builder.addCommunityRelation(0, 0) builder.addCommunityRelation(1, 1) builder.addCommunityRelation(2, 1) model = builder.getModel() return model
def TreeGraphModel(): builder = BipartitniModelBuilder((80, 80)) builder.addCommunityA(range(20)) builder.addCommunityA(range(20, 40)) builder.addCommunityA(range(40, 60)) builder.addCommunityA(range(60, 80)) builder.addCommunityB(range(20)) builder.addCommunityB(range(20, 40)) builder.addCommunityB(range(40, 60)) builder.addCommunityB(range(60, 80)) builder.addCommunityRelation(0, 0) builder.addCommunityRelation(0, 1) builder.addCommunityRelation(0, 2) builder.addCommunityRelation(1, 1) builder.addCommunityRelation(1, 3) builder.addCommunityRelation(2, 3) builder.addCommunityRelation(3, 3) model = builder.getModel() return model
def BipartiteOverlappingGraphModel(common=(10, 10)): C = [int(c / 2) for c in common] builder = BipartitniModelBuilder((50, 90)) builder.addCommunityA(range(25 + C[0])) builder.addCommunityA(range(25 - C[0], 50)) builder.addCommunityB(range(30)) builder.addCommunityB(range(30 - C[1], 60 + C[0])) builder.addCommunityB(range(60, 90)) builder.addCommunityRelation(0, 0) builder.addCommunityRelation(0, 1) builder.addCommunityRelation(1, 1) builder.addCommunityRelation(1, 2) model = builder.getModel() return model
def BipartitniGrafSPrekryvem(): builder = BipartitniModelBuilder((50, 50)) builder.addCommunityA(range(30)) builder.addCommunityA(range(20, 50)) builder.addCommunityB(range(20)) builder.addCommunityB(range(15, 35)) builder.addCommunityB(range(30, 50)) builder.addCommunityRelation(0, 0) builder.addCommunityRelation(0, 1) builder.addCommunityRelation(1, 1) builder.addCommunityRelation(1, 2) model = builder.getModel() generateDetectAndSave(model, 'bipartitniSPrekryvem.gexf')