Graph - Operator (Operations)

Graph

About

Language - Operator on a graph

List

Operations Description
degree(G, x) the number of adjacent (connected) edge for the node x (ie degree)
adjacent(G, x, y) adjacent tests whether there is an edge from the vertex x to the vertex y;
neighbors(G, x) lists all vertices y such that there is an edge from the vertex x to the vertex y;
add_vertex(G, x) adds the vertex x, if it is not there;
remove_vertex(G, x) removes the vertex x, if it is there;
add_edge(G, x, y) adds the edge from the vertex x to the vertex y, if it is not there;
remove_edge(G, x, y) removes the edge from the vertex x to the vertex y, if it is there;
get_vertex_value(G, x) returns the value associated with the vertex x;
set_vertex_value(G, x, v) sets the value associated with the vertex x to v.
get_edge_value(G, x, y) returns the value associated with the edge (x, y);
set_edge_value(G, x, y, v) sets the value associated with the edge (x, y) to v.

Library

Documentation / Reference





Discover More
Graph
Graph - Adjacent (is adjacent to, connected)

adjacent is a graph operator that tests if there is an edge between two vertices; The two vertices have the following binary relation, if the test is: true: is adjacent to false: is not adjacent...



Share this page:
Follow us:
Task Runner