Last active
September 13, 2017 21:35
-
-
Save disa-mhembere/d4ba6d7342058da3a20a9067e04e3f42 to your computer and use it in GitHub Desktop.
D3M graph interface
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Graph(object): | |
adjacency_matrix = None | |
_num_vertices = None | |
_num_edges = None | |
_directed = None | |
_weighted = None | |
_dangling_nodes = None | |
def __init__(self): | |
pass | |
def read_graph(self, fname, dtype="gml"): | |
pass | |
def compute_statistics(self): | |
pass | |
def get_adjacency_matrix(self): | |
return self.adjacency_matrix | |
def get_num_vertices(self): | |
return self._num_vertices | |
def get_num_edges(self): | |
return self._num_edges | |
def is_directed(self): | |
return self._directed | |
def has_dangling_nodes(self): | |
if (self._dangling_nodes is None): | |
self.compute_statistics() | |
return self._dangling_nodes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment