Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: New User to Graph::Directed Seeks Help!!

by amphiplex (Monk)
on Jul 19, 2002 at 09:05 UTC ( [id://183170]=note: print w/replies, xml ) Need Help??


in reply to New User to Graph::Directed Seeks Help!!

Maybe this helps:
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 attribut +e 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") : "<undef>") ."\n";

update: I think you missread the docs concerning has_vertices:
@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.

---- amphiplex

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://183170]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (1)
As of 2024-04-25 00:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found