processes graph and ports graph