# Path: pyBN/utils/class_equivalence.py
# def are_class_equivalent(x,y):
# 	"""
# 	Check whether two Bayesian networks belong
# 	to the same equivalence class.
# 	"""
# 	are_equivalent = True
# 
# 	if set(list(x.nodes())) != set(list(y.nodes())):
# 		are_equivalent = False
# 	else:
# 		for rv in x.nodes():
# 			rv_x_neighbors = set(x.parents(rv)) + set(y.children(rv))
# 			rv_y_neighbors = set(y.parents(rv)) + set(y.children(rv))
# 			if rv_x_neighbors != rv_y_neighbors:
# 				are_equivalent =  False
# 				break
# 	return are_equivalent
# 
# Path: pyBN/utils/graph.py
# def topsort(edge_dict, root=None):
# 	"""
# 	List of nodes in topological sort order from edge dict
# 	where key = rv and value = list of rv's children
# 	"""
# 	queue = []
# 	if root is not None:
# 		queue = [root]
# 	else:
# 		for rv in edge_dict.keys():
# 			prior=True
# 			for p in edge_dict.keys():
# 				if rv in edge_dict[p]:
# 					prior=False
# 			if prior==True:
# 				queue.append(rv)
# 	
# 	visited = []
# 	while queue:
# 		vertex = queue.pop(0)
# 		if vertex not in visited:
# 			visited.append(vertex)
# 			for nbr in edge_dict[vertex]:
# 				queue.append(nbr)
# 			#queue.extend(edge_dict[vertex]) # add all vertex's children
# 	return visited


from copy import copy, deepcopy
from pyBN.utils.class_equivalence import are_class_equivalent
from pyBN.utils.graph import topsort
import numpy as np
            import pyBN.io.read as ior


- Bayesian Network -

    - F -
        key:
            - rv -
        values:
            - children -
            - parents -
            - values -
            - cpt -

    - V -
        - list of rvs -

    - E -
        key:
            - rv -
        values:
            - list of rv's children -
Notes
-----
- Edges can be inferred from Factorization, but Vertex values 
    must be specified.
"""

__author__ = """Nicholas Cullen <ncullen.th@dartmouth.edu>"""




# Path: pyBN/utils/class_equivalence.py
# def are_class_equivalent(x,y):
# 	"""
# 	Check whether two Bayesian networks belong
# 	to the same equivalence class.
# 	"""
# 	are_equivalent = True
# 
# 	if set(list(x.nodes())) != set(list(y.nodes())):
# 		are_equivalent = False
# 	else:
# 		for rv in x.nodes():
# 			rv_x_neighbors = set(x.parents(rv)) + set(y.children(rv))
# 			rv_y_neighbors = set(y.parents(rv)) + set(y.children(rv))
# 			if rv_x_neighbors != rv_y_neighbors:
# 				are_equivalent =  False
# 				break
# 	return are_equivalent
# 
# Path: pyBN/utils/graph.py
# def topsort(edge_dict, root=None):
# 	"""
# 	List of nodes in topological sort order from edge dict
# 	where key = rv and value = list of rv's children
# 	"""
# 	queue = []
# 	if root is not None:
# 		queue = [root]
# 	else:
# 		for rv in edge_dict.keys():
# 			prior=True
# 			for p in edge_dict.keys():
# 				if rv in edge_dict[p]:
# 					prior=False
# 			if prior==True:
# 				queue.append(rv)
# 	
# 	visited = []
# 	while queue:
# 		vertex = queue.pop(0)
# 		if vertex not in visited:
# 			visited.append(vertex)
# 			for nbr in edge_dict[vertex]:
# 				queue.append(nbr)
# 			#queue.extend(edge_dict[vertex]) # add all vertex's children
# 	return visited


# Path: pyBN/classes/bayesnet.py
from copy import copy, deepcopy
from pyBN.utils.class_equivalence import are_class_equivalent
from pyBN.utils.graph import topsort
import numpy as np
            import pyBN.io.read as ior


- Bayesian Network -

    - F -
        key:
            - rv -
        values:
            - children -
            - parents -
            - values -
            - cpt -

    - V -
        - list of rvs -

    - E -
        key:
            - rv -
        values:
            - list of rv's children -
Notes
-----
- Edges can be inferred from Factorization, but Vertex values 
    must be specified.
"""

__author__ = """Nicholas Cullen <ncullen.th@dartmouth.edu>"""




class BayesNet(object):
