def test_negative_graph(self):
        expected_negative_graph = copy.copy(self.graph)
        expected_negative_graph.delete_edges([0, 2])

        splitter = graph_splitter.GraphSplitter()
        negative_graph = splitter.negative_graph(self.graph)

        comparer = graph_comparer.GraphComparer()
        self.assertTrue(comparer.equal(expected_negative_graph,
                                       negative_graph))
    def test_positive_graph(self):
        expected_positive_graph = copy.copy(self.graph)
        expected_positive_graph.delete_edges([1, 3])

        splitter = graph_splitter.GraphSplitter()
        positive_graph = splitter.positive_graph(self.graph)

        comparer = graph_comparer.GraphComparer()
        self.assertTrue(comparer.equal(positive_graph,
                                       expected_positive_graph))
Beispiel #3
0
    def setUp(self):
        self.graph = igraph.Graph()

        self.graph.add_vertices(7)
        self.graph.add_edges([(1, 2), (3, 4), (2, 4), (4, 5), (5, 6)])
        self.graph.es['sign'] = [1, -1, 1, -1, -1]

        self.graph.es['edge sequence attribute'] = (
            'edge sequence attribute value')
        self.graph.es[2]['edge attribute'] = 'edge attribute value'
        self.graph.vs['vertex sequence attribute'] = (
            'vertex sequence attribute value')
        self.graph.vs[5]['vertex attribute'] = 'vertex attribute value'
        self.graph['graph attribute'] = 'graph attribute value'

        splitter = graph_splitter.GraphSplitter()
        self.finder = community_finder.CommunityFinder(splitter)
        self.comparer = graph_comparer.GraphComparer()
Beispiel #4
0
 def setUp(self):
     splitter = graph_splitter.GraphSplitter()
     finder = community_finder.CommunityFinder(splitter)
     self.generator = generator.CommunityCSVGenerator(finder)
import community_detection_gui.src.vertex_colorer as vertex_colorer
import community_detection_gui.src.edge_colorer as edge_colorer
import community_detection_gui.src.graph_plotter as graph_plotter
import community_detection_gui.src.plot_gui as plot_gui

import community_detection_gui.src.community_csv_generator as community_csv_generator

import community_detection_gui.src.community_gui as community_gui

import community_detection_gui.src.graph_file_opener as graph_file_opener

PathHelper = path_helper.PathHelper()
GraphLoader = graph_loader.GraphLoader(PathHelper)

GraphSplitter = graph_splitter.GraphSplitter()
CommunityFinder = community_finder.CommunityFinder(GraphSplitter)

CommunityCSVGenerator = community_csv_generator.CommunityCSVGenerator()

VertexColorer = vertex_colorer.VertexColorer()
EdgeColorer = edge_colorer.EdgeColorer()
GraphPlotter = graph_plotter.GraphPlotter(VertexColorer, EdgeColorer)
PlotGUI = plot_gui.PlotGUI(GraphPlotter)

CommunityGUI = community_gui.CommunityGUI(
    CommunityFinder, CommunityCSVGenerator, PlotGUI
    )

GraphFileOpener = graph_file_opener.GraphFileOpener(
    GraphLoader, CommunityGUI