Graph Implementation

not yet finished, could be optimized, just for the first test cases