Created
September 13, 2017 21:26
-
-
Save disa-mhembere/c1a4db60be6b90bbe99f2a6c758f0a93 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): | |
self.adjacency_matrix = None | |
self._num_vertices = None | |
self._num_edges = None | |
self._directed = None | |
self._weighted = None | |
self._dangling_nodes = None | |
def __init__(self,): | |
pass | |
def read_graph(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