Representing connectios as a graph