ADD graph structure to deal with the graph related operations.
FIX some methods were optimized.
REFACTOR graph class & improvements on bayesnetwork algorithm