Contents

Graph::getEdgeCosts

Returns a table with the edge costs.

Use only in the MuPAD Notebook Interface.

This functionality does not run in MATLAB.

Syntax

Graph::getEdgeCosts(G)

Description

Graph::getEdgeCosts(G) returns a table with the edge costs of the graph G. Thus Graph::getEdgeCosts(G) returns the costs of all edges in G.

    Note:   Costs will most probably only be defined, if transportation problems occur.

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

Examples

Example 1

First lets define a graph without edge costs:

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

FAIL was returned, because no edge costs were defined.

Graph::getEdges(G1);
G1 := Graph::setEdgeCosts(G1, [[1, 2], [3, 1]], [5, 1/2]):
Graph::getEdgeCosts(G1)

The first output shows all the edges and the second one the assigned edge costs.

Parameters

G

A graph

Return Values

Table

Was this topic helpful?