Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Graph::checkForVertices

Checks if all vertices in edges really exist.

MuPAD® notebooks are not recommended. Use MATLAB® live scripts instead.

MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.

Syntax

Graph::checkForVertices(Edge, Vertex)

Description

Graph::checkForVertices(Edge, Vertex) checks if all vertices out of Edge are in Vertex.

Examples

Example 1

What vertices are within the stated edges, but not in the vertex list?

Graph::checkForVertices([[a, b], [1, 2]], [a, 2])

Neither b nor 1 were in the second list. a was in the first edge and 2 in the second.

Example 2

A more complex example. The second list contains a vertex that does not exist in the graph at all. For the checking it does not matter though. Every vertex NOT in the second list is to be returned. In the end it does not matter if the vertex-list contains vertices that are not existent, because only existing vertices are returned.

G := Graph::createCompleteGraph(10):
Graph::checkForVertices(Graph::getEdges(G), [1, 2, 3, 11])

Parameters

Edge

List of one or more Edges

Vertex

List of one or more vertices

Return Values

List with the vertices out of the Edges that were not stated in Vertex.

Was this topic helpful?