<s> """<STR_LIT>""" <EOL> from networkx import * <EOL> G = lollipop_graph ( <NUM_LIT:4> , <NUM_LIT:6> ) <EOL> pathlengths = [ ] <EOL> print ( "<STR_LIT>" ) <EOL> for v in G . nodes ( ) : <EOL> spl = single_source_shortest_path_length ( G , v ) <EOL> print ( '<STR_LIT>' % ( v , spl ) ) <EOL> for p in spl . values ( ) : <EOL> pathlengths . append ( p ) <EOL> print ( '<STR_LIT>' ) <EOL> print ( "<STR_LIT>" % ( sum ( pathlengths ) / len ( pathlengths ) ) ) <EOL> dist = { } <EOL> for p in pathlengths : <EOL> if p in dist : <EOL> dist [ p ] += <NUM_LIT:1> <EOL> else : <EOL> dist [ p ] = <NUM_LIT:1> <EOL> print ( '<STR_LIT>' ) <EOL> print ( "<STR_LIT>" ) <EOL> verts = dist . keys ( ) <EOL> for d in sorted ( verts ) : <EOL> print ( '<STR_LIT>' % ( d , dist [ d ] ) ) <EOL> print ( "<STR_LIT>" % radius ( G ) ) <EOL> print ( "<STR_LIT>" % diameter ( G ) ) <EOL> print ( "<STR_LIT>" % eccentricity ( G ) ) <EOL> print ( "<STR_LIT>" % center ( G ) ) <EOL> print ( "<STR_LIT>" % periphery ( G ) ) <EOL> print ( "<STR_LIT>" % density ( G ) ) </s>
