Documentation Center

  • Trial Software
  • Product Updates

Contents

Graph::getVertexWeights

Returns a table with the vertex weights.

Use only in the MuPAD Notebook Interface.

This functionality does not run in MATLAB.

Syntax

Graph::getVertexWeights(G)

Description

Graph::getVertexWeights(G) returns a table with the vertex weights of the graph G. Thus Graph::getVertexWeights(G) returns the weight of all vertices in G.

    Note:   If FAIL is returned, no weights were defined (this way both, network and graph algorithms handle this situation correct.)

Examples

Example 1

First lets define a graph without vertex weights:

G1 := Graph::createCircleGraph(3):
Graph::getVertexWeights(G1)

FAIL was returned, because no vertex weights were defined.

Graph::getVertices(G1);
G1 := Graph::setVertexWeights(G1, [1, 3], [5, 1/2]):
Graph::getVertexWeights(G1)

The first output shows all the vertices and the second one the assigned vertex weights.

Parameters

G

A graph

Return Values

Table

Was this topic helpful?