Graph Constructor

Applicable Products

All processors

Function Usage

Creates a graph object.

Prototype

1
Graph(name: Optional[str] = "graph")

Parameters

Parameter

Input/Output

Description

name

Input

Graph name.

The value is of the string type. The default value is graph.

Returns

Created graph object

Restrictions

  • If name is not a string, TypeError is thrown.
  • If the graph fails to be created, RuntimeError is thrown.

Example

1
graph = Graph("my_graph")