print "number of vertices: ".$G->vertices."\n"; print "number of edges: ".$G->edges."\n"; print "vertices: ".join (':',$G->vertices)."\n"; print "edges: ".join (':',$G->edges)."\n"; # set attribute name to "A" for edge E1 -> E2 $G->set_attribute("name","E1","E2","A") or die "error setting attribute to edge: $!\n"; print "Name of edge E1->E2 is ".$G->get_attribute("name","E1","E2")."\n"; print "Name of edge E2->E3 is ". (defined $G->get_attribute("name","E2","E3") ? $G->get_attribute("name","E2","E3") : "") ."\n"; #### @V = $G->vertices In list context returns the vertices @V of the graph $G. In scalar context returns the number of the vertices. $G->has_vertices(@v) In list context returns a list which contains the vertex of the vertices @v if the vertex exists in the graph $G and undef if it doesn't. In scalar context returns the number of the existing vertices.