test if graph is directed
test if graph is weighted
The IsDirected(G) function returns true or false depending on whether the input graph is a directed or undirected graph.
The IsWeighted(G) function returns true if G is a weighted graph, and false otherwise.
To make a graph directed or weighted, use the MakeDirected or MakeWeighted commands.
To remove directions and weights from a graph, use the UnderlyingGraph command.
G ≔ Graph⁡1,2,2,3,3,1
G≔Graph 1: a directed graph with 3 vertices and 3 arc(s)
K3 ≔ CompleteGraph⁡3
K3≔Graph 2: an undirected graph with 3 vertices and 3 edge(s)
H ≔ Graph⁡1,2,2,2,3,3
H≔Graph 3: an undirected weighted graph with 3 vertices and 2 edge(s)
K3≔Graph 4: an undirected graph with 3 vertices and 3 edge(s)
K3 ≔ MakeWeighted⁡K3
K3≔Graph 5: an undirected weighted graph with 3 vertices and 3 edge(s)
Download Help Document
What kind of issue would you like to report? (Optional)