code optimised in eulerian path
connected graph added (need optimisation)