update classes with compression operations:
class Edge
class Graph
Updated version for bugs correction.