Directed graph using the adjacency matrix
List < List < int > > relation = new List < List < int > > ( ) ; relation . Add ( new List < int > { 1 } ) ; relation . Add ( new List < int > { 0 , 2 } ) ; relation . Add ( new List < int > { 0 , 1 , 3 , 4 } ) ; relation . Add ( new List < int > { 2 , 4 } ) ; relation . Add ( new List < int > { 0 } ) ;