Adjacency List
adj [ 1 ] . append ( 2 ) NEW_LINE adj [ 2 ] . append ( 1 ) NEW_LINE adj [ 2 ] . append ( 3 ) NEW_LINE adj [ 3 ] . append ( 2 ) NEW_LINE adj [ 3 ] . append ( 4 ) NEW_LINE adj [ 4 ] . append ( 3 ) NEW_LINE adj [ 1 ] . append ( 5 ) NEW_LINE adj [ 5 ] . append ( 1 ) NEW_LINE a [ 1 ] = 4 NEW_LINE a [ 2 ] = 9 NEW_LINE a [ 3 ] = 14 NEW_LINE a [ 4 ] = 100 NEW_LINE a [ 5 ] = 5 NEW_LINE