Skip to content

Commit

Permalink
added networkx representation to DAG class
Browse files Browse the repository at this point in the history
  • Loading branch information
jrzkaminski committed Jul 10, 2024
1 parent 638b792 commit 7679c6c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 38 deletions.
25 changes: 11 additions & 14 deletions bamt/core/graph/dag.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
from .graph import Graph
from networkx import DiGraph


class DirectedAcyclicGraph(Graph):
def __init__(self):
super().__init__()
self._networkx_graph = DiGraph()

def add_edge(self):
pass
def __getattr__(self, item):
return getattr(self._networkx_graph, item)

def remove_edge(self):
pass
def __setattr__(self, key, value):
setattr(self._networkx_graph, key, value)

def get_parents(self):
pass
def __delattr__(self, item):
delattr(self._networkx_graph, item)

def get_children(self):
pass

def get_edges(self):
pass

def get_nodes(self):
pass
@property
def networkx_graph(self):
return self._networkx_graph
24 changes: 0 additions & 24 deletions bamt/core/graph/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,3 @@
class Graph(ABC):
def __init__(self):
pass

@abstractmethod
def add_edge(self):
pass

@abstractmethod
def remove_edge(self):
pass

@abstractmethod
def get_parents(self):
pass

@abstractmethod
def get_children(self):
pass

@abstractmethod
def get_edges(self):
pass

@abstractmethod
def get_nodes(self):
pass

0 comments on commit 7679c6c

Please sign in to comment.