-
Notifications
You must be signed in to change notification settings - Fork 4
Basic Inspection
Ed Scheinerman edited this page Sep 28, 2020
·
14 revisions
-
NV(G): the number of vertices. -
NE(G): the number of edges. -
vlist(G): list containing the vertices. -
elist(G): list containing the edges.
Note that G.V and G.E give direct access to the vertex and edge sets of the graph. Look but don't touch.
-
has(G,v): isva vertex ofG? -
has(G,v,w): is(v,w)an edge ofG? -
get_edge(G,u,v)returns either(u,v)or(v,u)matching how the edge is represented inG.E. An error is thrown ifuandvare not adjacent vertices ofG. -
adjacency(G): the adjacency matrix ofG.
-
neighbors(G,v): list ofv's neighbors. AlsoG[v]. -
deg(G,v): degree of vertexv. -
deg(G): sorted list of vertex degrees.
See also deg_hist.
-
twins(G,u,v)returnstrueif verticesuandvare twins inG. The definition of twins is thatG[u]-v == G[v]-u. This is an equivalence relation. -
twins(G)returns a partition of the vertex set ofGinto twin classes.