tulip module API

Utility functions

Graph management

tlp.newGraph()

Creates and returns a new empty graph.

Return type:tlp.Graph
tlp.loadGraph(filename[, graph = None])

Loads a graph in the TLP format from a file (extension can be .tlp or .tlp.gz). Returns the graph (a new graph if none is provided) or None if the import fails.

Parameters:
  • filename (string) – the path to the tlp file
  • graph – if provided, import new graph elements in that already existing graph
Return type:

tlp.Graph

tlp.loadGraph(fileName)

Loads a graph serialized in a file trough the available Tulip import plugins.

Since Tulip 4.8, the selection of the import plugin is based on the provided filename extension. The import will fail if the selected import plugin is not loaded. The graph file formats that can currently be imported are : TLP (.tlp or .tlp.gz), TLP Binary (.tlpb or .tlpb.gz), TLP JSON (.json), Gephi (.gexf), Pajek (.net, .paj), GML (.gml), Graphviz (.dot) and UCINET (.txt).

Before Tulip 4.8 and as a fallback, the function uses the “TLP Import” import plugin (always loaded as it is linked into the tulip-core library).

Returns a new graph or None if the import fails.

Parameters:filename (string) – the path to the file in one of the supported formats to parse.
Return type:tlp.Graph
tlp.saveGraph(graph, filename)

Serializes the corresponding graph and all its sub-graphs (depending on the format) to a file through the available Tulip export plugins.

Since Tulip 4.8, the selection of the export plugin is based on the provided filename extension. The export will fail if the selected export plugin is not loaded. The file formats the graph can be exported to are : TLP (.tlp or .tlp.gz), TLP Binary (.tlpb or .tlpb.gz), TLP JSON (.json) and GML (.gml).

This function checks the file name for the ‘.gz’ extension and uses a compressed output if supported (TLP and TLP Binary only).

Before Tulip 4.8 and as a fallback, this function uses the “TLP Export” export plugin (always loaded as it is linked into the tulip-core library).

Returns whether the export was successfull or not.

Parameters:
  • graph (tlp.Graph) – the graph to export
  • filename (string) – the path to the destination file
Return type:

boolean

tlp.saveGraph(graph)

New in version 4.5.

Saves a graph to the same file from which it has been loaded (if the ouput format is supported). Returns True if the graph has been successfully saved.

Parameters:graph (tlp.Graph) – the graph to export
Return type:boolean
Throws:an exception if there is no file attached to the graph
tlp.importGraph(importPluginName[, params, newGraph = None])

Imports a graph using a Tulip import plugin. Returns a new graph or None if the import fails.

Parameters:
  • importPluginName (string) – the name of the Tulip import plugin
  • params (a dictionnary with string keys (parameters names) and parameters values) – The parameters to the algorithm.
  • newGraph (tlp.Graph) – if provided, add imported graph elements in that graph
Return type:

tlp.Graph

Throws:

an exception if the requested import plugin is not registered in the plugins database.

tlp.exportGraph(exportPluginName, graph, outputFilePath[, params])

Exports a graph to a file using a Tulip export plugin.

Parameters:
  • graph (tlp.Graph) – the graph to export
  • outputFilePath (string) – the path of the file the export plugin will write to
  • exportPluginName (string) – the name of the Tulip export plugin to execute
  • params (a dictionnary with string keys (parameters names) and parameters values) – The parameters to the algorithm.
Return type:

boolean

Throws:

an exception if the requested export plugin is not registered in the plugins database.

tlp.copyToGraph(outGraph, inGraph[, inSelection = None, outSelection = None])

Appends the selected part of a graph (properties, nodes and edges) into another one. If no selection is done, the whole input graph graph is appended. The output selection is used to select the appended nodes & edges

Parameters:
  • outGraph (tlp.Graph) – the graph on which to append elements
  • inGraph (tlp.Graph) – the graph to append
  • inSelection (tlp.BooleanProperty) – boolean property attached to inGraph, only selected elements will be appended if provided
  • outSelection (tlp.BooleanProperty) – boolean property attached to outGraph, appended nodes and edges will be selected if provided

Warning

The input selection is extended to all selected edge ends.

tlp.removeFromGraph(inGraph[, inSelection = None])

Removes the selected part of a graph (properties values, nodes and edges). If no selection is done, the whole graph is reseted to default value.

Parameters:
  • inGraph (tlp.Graph) – the graph on which to remove elements
  • inSelection (tlp.BooleanProperty) – boolean property attached to inGraph, only selected elements will be removed if provided

Warning

The selection is extended to all selected edge ends.

tlp.getRootGraphs()

Returns an iterator on all the currently existing root graphs.

Return type:a Tulip iterator on tlp.Graph objects

Graph measures and functions

tlp.averagePathLength(graph)

Returns the average path length of a graph, that is the sum of the shortest distances for all pair of distinct nodes in that graph divided by the number of those pairs. For a pair of non connected nodes, the shorted distance is set to 0.

Parameters:graph (tlp.Graph) – the graph on which to compute the average path length
Return type:float
tlp.averageClusteringCoefficient(graph)

Returns the clustering coefficient of a graph as the average of the local clustering coefficients (see tlp.clusteringCoefficient()) of all the nodes.

Parameters:graph (tlp.Graph) – the graph on wich to compute the average clustering coefficient
Return type:float
tlp.clusteringCoefficient(graph, result[, maxDepth = 1])

Assigns to each node its local clustering coefficient that is the proportion of edges between the nodes within its neighbourhood divided by the number of edges that could possibly exist between them. This quantifies how close its neighbors are to being a clique.

Parameters:
  • graph (tlp.Graph) – the graph on which to compute the clustering coefficient for each node
  • result (tlp.DoubleProperty) – a graph property in which the results will be stored
  • maxDepth (integer) – the maximum distance between each node and its neighbours.
tlp.dagLevel(graph, result)

Assigns to each node of a Directed Acyclic Graph a level such that if the edge e(u,v) exists level(u) < level(v). The algorithm ensures that the number of level used is minimal.

Parameters:
  • graph (tlp.Graph) – the graph on which to compute the dag level
  • result (tlp.IntegerProperty) – a graph property in which the results will be stored

Warning

The graph must be acyclic (no self loops).

tlp.minDegree(graph)

Returns the minimum degree of the graph’s nodes.

Parameters:graph (tlp.Graph) – the graph on which to compute the minimum degree
Return type:integer
tlp.maxDegree(graph)

Returns the maximum degree of the graph’s nodes.

Parameters:graph (tlp.Graph) – the graph on which to compute the maximum degree
Return type:integer
tlp.maxDistance(graph, node, result, direction)

Computes the distances from a node to all the other nodes of a graph and return the maximum one.

Parameters:
  • graph (tlp.Graph) – the graph on which to compute the maximum distance
  • node (tlp.node) – an existing graph node
  • result (tlp.IntegerProperty) – a graph property in which the results will be stored
  • direction (tlp.DIRECTED, tlp.INV_DIRECTED, tlp.UNDIRECTED) – specify if the graph must be directed or not
Return type:

integer

Throws:

an exception if the node does not belong to the graph

tlp.reachableNodes(graph, startNode, maxDistance, direction)

Returns the nodes that can be reached from a node, according to a direction, at distance less or equal to a maximum one.

Parameters:
  • graph (tlp.Graph) – the graph to work on
  • startNode (tlp.node) – an existing graph node
  • maxDistance (integer) – the maximum distance to reach nodes
  • direction (tlp.DIRECTED, tlp.INV_DIRECTED, tlp.UNDIRECTED) – specify if the graph must be directed or not
Return type:

set of tlp.node

Throws:

an exception if the node does not belong to the graph

tlp.bfs(graph[, root])

New in version 4.2.

Performs a breadth-first search on a graph and returns a list containing the nodes of the graph in the order they have been visited.

Parameters:
  • graph (tlp.Graph) – The graph to traverse with a BFS.
  • root (tlp.node) – The node from whom to start the BFS. If not provided, the root node will be assigned to a source node in the graph (node with input degree equals to 0). If there is no source node in the graph, a random node will be picked.
Return type:

list of tlp.node

Throws:

an exception if the provided root node does not belong to the graph.

tlp.dfs(graph[, root])

New in version 4.2.

Performs a depth-first search on a graph and returns a list containing the nodes of the graph in the order they have been visited.

Parameters:
  • graph (tlp.Graph) – The graph to traverse with a DFS.
  • root (tlp.node) – The node from whom to start the DFS. If not provided, the root node will be assigned to a source node in the graph (node with input degree equals to 0). If there is no source node in the graph, a random node will be picked.
Return type:

list of tlp.node

Throws:

an exception if the provided root node does not belong to the graph.

Geometry

tlp.computeBoundingBox(graph[, selection = None])

New in version 3.8.

Computes the bounding box of a graph according to nodes positions and edges bends defined in the default layout property “viewLayout”, nodes z-rotations defined in the default double property “viewRotation” and sizes of elements defined in the default size property “viewSize”.

Parameters:
  • graph (tlp.Graph) – the graph on which to compute its bounding box
  • selection (tlp.BooleanProperty) – a boolean property to restrain the computation of the bounding box to selected elements (if provided)
Return type:

tlp.BoundingBox

Throws:

an exception if the provided boolean property is not attached to the graph

tlp.computeBoundingBox(graph, layout, size, rotation[, selection = None])

Computes the bounding box of a graph according to nodes positions, edges bends, nodes z-rotations and sizes of elements.

Parameters:
  • graph (tlp.Graph) – the graph on which to compute its bounding box
  • layout (tlp.LayoutProperty) – a layout property containing positions of the graph elements
  • size (tlp.SizeProperty) – a size property containing the sizes of the graph elements.
  • rotation (tlp.DoubleProperty) – a double property containing the z-rotations of nodes
  • selection (tlp.BooleanProperty) – a boolean property to restrain the computation of the bounding box to selected elements (if provided)
Return type:

tlp.BoundingBox

Throws:

an exception if the provided properties are not attached to the graph

tlp.computeBoundingRadius(graph[, selection = None])

New in version 3.8.

Computes a bounding sphere (or a bounding circle if the graph has a 2D layout) of a graph according to nodes positions and edges bends defined in the default layout property “viewLayout”, nodes z-rotations defined in the default double property “viewRotation” and sizes of elements defined in the default size property “viewSize”.

Returns a tuple of tlp.Coord whose first member is the center of the bounding sphere (circle for 2D layout) and second member is the farthest point from the center (computed from graph elements positions). To get the bounding radius, you have to compute the distance between the two members of the tuple (use the tlp.Vec3f.dist() method).

Parameters:
  • graph (tlp.Graph) – the graph on which to compute its bounding sphere
  • selection (tlp.BooleanProperty) – a boolean property to restrain the computation of the bounding sphere to selected elements (if provided)
Return type:

(tlp.Coord, tlp.Coord)

Throws:

an exception if the provided boolean property is not attached to the graph

tlp.computeBoundingRadius(graph, layout, size, rotation[, selection = None])

Computes a bounding sphere (or a bounding circle if the graph has a 2D layout) of a graph according to node position edge bends node z-rotation, and size of elements.

Returns a tuple of tlp.Coord whose first member is the center of the bounding sphere (circle for 2D layout) and second member is the farthest point from the center (computed from graph elements positions). To get the bounding radius, you have to compute the distance between the two members of the tuple (use the tlp.Vec3f.dist() method).

Parameters:
  • graph (tlp.Graph) – the graph on which to compute its bounding sphere
  • layout (tlp.LayoutProperty) – a layout property containing positions of the graph elements
  • size (tlp.SizeProperty) – a size property containing the sizes of the graph elements.
  • rotation (tlp.DoubleProperty) – a double property containing the z-rotations of nodes
  • selection (tlp.BooleanProperty) – a boolean property to restrain the computation of the bounding sphere to selected elements (if provided)
Return type:

(tlp.Coord, tlp.Coord)

Throws:

an exception if the provided properties are not attached to the graph

tlp.computeConvexHull(points)

New in version 3.8.

Computes a convex hull of a set of points. Only works with 2D layouts. Returns a list of tlp.Coord containing the vertices of the points convex hull correctly ordered.

Parameters:points (:list of class:tlp.Coord) – the points on which to compute a conbex hull
Return type:list of tlp.Coord
tlp.computeConvexHull(graph[, selection = None])

New in version 3.8.

Computes a convex hull of a graph according to nodes positions and edges bends defined in the default layout property “viewLayout”, nodes z-rotations defined in the default double property “viewRotation” and sizes of elements defined in the default size property “viewSize”. Only works with 2D layouts. Returns a list of tlp.Coord containing the vertices of the graph convex hull correctly ordered.

Parameters:
  • graph (tlp.Graph) – the graph on which to compute its convex hull
  • selection (tlp.BooleanProperty) – a boolean property to restrain the computation of the convex hull to selected elements (if provided)
Return type:

list of tlp.Coord

Throws:

an exception if the provided boolean property is not attached to the graph

tlp.computeConvexHull(graph, layout, size, rotation[, selection = None])

Computes a convex hull of a graph according to nodes positions, edges bends, nodes z-rotations, and sizes of elements. Only works with 2D layouts. Returns a list of tlp.Coord containing the vertices of the graph convex hull correctly ordered.

Parameters:
  • graph (tlp.Graph) – the graph on which to compute its convex hull
  • layout (tlp.LayoutProperty) – a layout property containing positions of the graph elements
  • size (tlp.SizeProperty) – a size property containing the sizes of the graph elements.
  • rotation (tlp.DoubleProperty) – a double property containing the z-rotations of nodes
  • selection (tlp.BooleanProperty) – a boolean property to restrain the computation of the convex hull to selected elements (if provided)
Return type:

list of tlp.Coord

Throws:

an exception if the provided properties are not attached to the graph

tlp.convexHull2D(points)

New in version 4.2.

Computes the 2D convex hull of a list of points (the z-coordinate is not taken into acccount) using the Qhull library. Returns a list of indexes in the list of points defining the hull polygon in counterclockwise order.

Parameters:points (list of tlp.Coord) – the points on which to compute the 2D convex hull
Return type:list of integers
tlp.convexHull(points)

New in version 4.2.

Computes the 2D/3D convex hull of a list of points using the Qhull library. Returns a tuple whose first member is the list of facets defining the convex hull (segments for 2D, triangles for 3D) and second member is the list of neighbors facets for each facet. A facet is defined by a list of indexes in the list of points. The ith element of the neighbors list is a list of indexes in the facets list corresponding to the neighbors facets of the ith facet.

Parameters:points (list of tlp.Coord) – the points on which to compute the 2D/3D convex hull
Return type:(list of list of integers, list of list of integers)
tlp.computeLinesIntersection(line1, line2)

New in version 3.8.

Computes the intersection point (if any) of two 3d lines. Returns a tuple whose first member is a boolean indicating if the lines intersect (if False it means that lines are parallel or skew) and second member is the intersection point (if any).

Parameters:
  • line1 ((tlp.Coord , tlp.Coord)) – the coordinates of the two points defining the first line
  • line2 ((tlp.Coord , tlp.Coord)) – the coordinates of the two points defining the second line
Return type:

(boolean, tlp.Coord)

tlp.computePolygonCentroid(points)

New in version 3.8.

Computes the centroid of a polygon.

Parameters:points (list of tlp.Coord) – the vertices of the polygon correctly ordered
Return type:tlp.Coord
tlp.delaunayTriangulation(points)

New in version 3.8.

Computes the delaunay triangulation of a set of points and returns the set of delaunay edges and simplices (triangles in 2d, tetrahedra in 3d). Returns a tuple whose first member is the list of edges and second member is the list of simplices, or None if the triangulation failed. Edges and simplices are defined using indexes into the original list of points.

Parameters:points (list of tlp.Coord) – a list of points on which to compute a delaunay triangulation
Return type:(list of (integer, integer), list of integer) or None
class tlp.VoronoiDiagram

New in version 3.8.

That class defines a voronoi diagram. Use the tlp.voronoiDiagram() function to get an instance of it.

cell(cellIdx)

Returns the ith voronoi cell. A cell is defined by a list of indexes in the voronoi vertices.

Parameters:cellIdx (integer) – the index of the cell to return
Return type:set of integer
degreeOfVertex(vertexIdx)

Returns the degree (number of incident edges) of the ith voronoi vertex

Parameters:vertexIdx (integer) – the index of the vertex on which to return the degree
Return type:integer
edge(edgeIdx)

Returns the ith voronoi edge. An edge is defined by two indexes in the voronoi vertices.

Parameters:edgeIdx (integer) – the index of the edge to return
Return type:(integer, integer)
nbEdges()

Returns the number of voronoi edges.

Return type:integer
nbSites()

Returns the number of voronoi sites.

Return type:integer
nbVertices()

Returns the number of voronoi vertices.

Return type:integer
site(siteIdx)

Returns the ith voronoi site.

Parameters:siteIdx (integer) – the index of the site to return
Return type:tlp.Coord
vertex(vertexIdx)

Returns the ith voronoi vertex.

Parameters:vertexIdx (integer) – the index of the vertex to return
Return type:tlp.Coord
voronoiCellForSite(siteIdx)

Returns the cell associated to the ith site.

Parameters:siteIdx (integer) – the index of the site on which to return the cell
Return type:set of integer
voronoiEdgesForSite(siteIdx)

Returns the voronoi edges surrounding the ith site.

Parameters:siteIdx (integer) – the index of the site on which to return edges
Return type:list of (integer, integer)
tlp.voronoiDiagram(sites)

New in version 3.8.

Computes the voronoi diagram of a set of sites (for 2d and 3d layouts). It automatically computes the set of all voronoi vertices, edges and cells. In order to not have to deal with infinite voronoi rays, the input layout is enclosed in its convex hull in 2d or in its bounding box in 3d. It enables to have a connected voronoi cell for each input site.

Parameters:sites (list of tlp.Coord) – the sites from which to compute the voronoi diagram
Return type:tlp.VoronoiDiagram

Plugins Management

tlp.getTulipRelease()

Returns the current version number of Tulip in the form X.Y.Z, X being the major version, Y the minor version, and Z the patch version.

Return type:string
tlp.initTulipLib()

Looks for the Tulip plugins directory and fills the Tulip path variables : tlp.TulipLibDir, tlp.TulipPluginsPath, tlp.TulipBitmapDir. The plug-ins directory can be defined in different ways, given by order of prevalence:

  • the TLP_DIR environment variable, if it has a value
  • the appDirPath parameter, if it is not NULL
  • at that point, the Tulip paths will be retrieved from the path of the loaded Tulip shared library (you must dispose of a standard Tulip installation for that feature to work, meaning the relative path for the Tulip plugins folder to the Tulip libraries one must be ../lib/tulip/).
  • a fallback value of ‘C:/Tulip/lib/’ on windows, or ‘/usr/local/lib/’ on Unix.
tlp.loadPlugins()

Loads C++ plugins installed in the directories listed in the tlp.TulipPluginsPath variable (in the form “<path1>;<path2>” on windows and “<path1>:<path2>” on unix). The tlp.TulipPluginsPath can be initialized with standard Tulip directories by calling the tlp.initTulipLib() function.

tlp.loadPluginsFromDir(pluginsDir)

New in version 4.2.

Loads C++ and Python plugins installed in a specific directory.

Since Tulip 4.8, the loading of plugins is done recursively, each subdirectory will be visited to search for plugins to load.

Parameters:pluginsDir – the root directory path to recursively search for python files (file extension: .py) or shared libraries containing the Tulip plugin (file extension : .so on linux, .dylib on mac, .dll on windows)
Return type:boolean
tlp.loadPlugin(filename)

Loads a C++ plugin or a Python plugin from a specific file (shared library or Python source file). Returns True if the plugin was correctly loaded.

Parameters:filename (string) – the path to the the python file (file extension: .py) or shared library containing the Tulip plugin (file extension : .so on linux, .dylib on mac, .dll on windows)
Return type:boolean
tlp.loadPluginsCheckDependencies()

Checks the dependencies of all C++ plugins loaded so far. If a plugin does not have all its dependencies fulfilled, it is unloaded and removed from the current plugins database.

tlp.getDefaultPluginParameters(pluginName[, graph = None])

Returns a Python dictionnary with string keys filled with default parameters (if any) for a given plugin (algorithm, import, property algorithm, ...).

Parameters:
  • pluginName (string) – the name of the plugin on which to retrieve its default parameters
  • graph (tlp.Graph) – if provided, property parameters will be retrieved from the graph if they exist
Return type:

dictionnary with string keys (parameters names) and parameters values

tlp.getImportPluginsList()

Return a list containing the names of the import plugins (written in C++ or Python) loaded so far. Import plugins are objects implementing the tlp::ImportModule interface in C++ or the tlp.ImportModule interface in Python.

Return type:list of string
tlp.getExportPluginsList()

Return a list containing the names of the export plugins (written in C++ or Python) loaded so far. Export plugins are objects implementing the tlp::ExportModule interface in C++ or the tlp.ExportModule interface in Python.

Return type:list of string
tlp.getAlgorithmPluginsList()

Return a list containing the names of the algorithm plugins (written in C++ or Python) loaded so far. Algorithm plugins are objects implementing the tlp::Algorithm interface in C++ or the tlp.Algorithm interface in Python.

Return type:list of string
tlp.getBooleanAlgorithmPluginsList()

Return a list containing the names of the boolean algorithm plugins (written in C++ or Python) loaded so far. Boolean algorithm plugins are objects implementing the tlp::BooleanAlgorithm interface in C++ or the tlp.BooleanAlgorithm interface in Python.

Return type:list of string
tlp.getColorAlgorithmPluginsList()

Return a list containing the names of the color algorithm plugins (written in C++ or Python) loaded so far. Color algorithm plugins are objects implementing the tlp::ColorAlgorithm interface in C++ or the tlp.ColorAlgorithm interface in Python.

Return type:list of string
tlp.getDoubleAlgorithmPluginsList()

Return a list containing the names of the double algorithm plugins (written in C++ or Python) loaded so far. Double algorithm plugins are objects implementing the tlp::DoubleAlgorithm interface in C++ or the tlp.DoubleAlgorithm interface in Python.

Return type:list of string
tlp.getIntegerAlgorithmPluginsList()

Return a list containing the names of the integer algorithm plugins (written in C++ or Python) loaded so far. Integer algorithm plugins are objects implementing the tlp::IntegerAlgorithm interface in C++ or the tlp.IntegerAlgorithm interface in Python.

Return type:list of string
tlp.getLayoutAlgorithmPluginsList()

Return a list containing the names of the layout algorithm plugins (written in C++ or Python) loaded so far. Layout algorithm plugins are objects implementing the tlp::LayoutAlgorithm interface in C++ or the tlp.LayoutAlgorithm interface in Python.

Return type:list of string
tlp.getSizeAlgorithmPluginsList()

Return a list containing the names of the size algorithm plugins (written in C++ or Python) loaded so far. Size algorithm plugins are objects implementing the tlp::SizeAlgorithm interface in C++ or the tlp.SizeAlgorithm interface in Python.

Return type:list of string
tlp.getStringAlgorithmPluginsList()

Return a list containing the names of the string algorithm plugins (written in C++ or Python) loaded so far. String algorithm plugins are objects implementing the tlp::StringAlgorithm interface in C++ or the tlp.StringAlgorithm interface in Python.

Return type:list of string

Graph elements classes

tlp.node

class tlp.node

An instance of this class represent a node in a Tulip graph. It encapsulates an integer identifier. Use specific methods in the tlp.Graph class to get references on such objects ( for instance tlp.Graph.addNode(), tlp.Graph.getNodes(), tlp.Graph.getOutNodes(), ...). Node objects can be used as keys in a Python dictionnary.

The node identifier can be accessed through the id class member.

isValid()

Returns True if the node is a valid one, meaning it is attached to a graph.

Return type:boolean

tlp.edge

class tlp.edge

An instance of this class represent an edge in a Tulip graph. It encapsulates an integer identifier. Use specific methods in the tlp.Graph class to get references on such objects ( for instance tlp.Graph.addEdge(), tlp.Graph.getEdges(), tlp.Graph.getInEdges(), ...). Edge objects can be used as keys in a Python dictionnary.

The edge identifier can be accessed through the id class member.

isValid()

Returns True if the edge is a valid one, meaning it is attached to a graph.

Return type:boolean

The tlp.Graph class

class tlp.Graph

This is the main Tulip class. It enables to :

  • create a directed graph
  • create and manipulate a sub-graphs hierarchy
  • get semantic iterators on graph elements
  • create and retrieve properties of different types to get/set data on the graph

This class can not be instanced directly. Use tlp.newGraph() to create a new empty graph.

Modification of the graph structure

tlp.Graph.clear()

Remove all nodes, edges and sub-graphs from the graph .

tlp.Graph.addNode()

Adds a new node in the graph and returns it. This node is also added in all the graph’s ancestors to maintain the sub-graph relation between graphs.

Return type:tlp.node
tlp.Graph.addNodes(nbNodes)

New in version 3.7.

Adds new nodes in the graph and returns them in a list. The new nodes are also added in all the graph ancestors to maintain the sub-graph relation between graphs.

Parameters:nbNodes (integer) – the number of nodes to add in the graph
Return type:list of tlp.node

Warning

the addedNodes vector is cleared before adding nodes.

tlp.Graph.addNode(node)

Adds an existing node in the graph. This node is also added in all the graph ancestors to maintain the sub-graph relation between graphs.

Parameters:node (tlp.node) – an existing node to add to the graph
Throws:an exception if the node does not belong to the root graph

Warning

The node must be an element of the graph hierarchy, thus it must be an element of the root graph.

Warning

One can’t add an existing node to the root graph.

tlp.Graph.addNodes(itNodes)

New in version 3.7.

Adds existing nodes in the graph. The nodes are also added in all the graph ancestors to maintain the sub-graph relation between graphs.

Parameters:itNodes (a Tulip iterator on tlp.node objects) – an iterator on nodes to add
Throws:an exception if one of the node to add is not an element of the root graph.

Warning

The added nodes must be elements of the graph hierarchy, thus they must be elements of the root graph.

Warning

One can’t add existing nodes to the root graph.

tlp.Graph.delNode(node[, deleteInAllGraphs = False])

Deletes a node in the graph. This node is also removed in all the sub-graphs of the graph to maintain the sub-graph relation between graphs.

Parameters:
  • node (tlp.node) – the node to delete
  • deleteInAllGraphs (boolean) – if True, remove the node in all the hierarchy of graphs
Throws:

an exception if the node does not belong to the graph

tlp.Graph.delNodes(itNodes[, deleteInAllGraphs=False])

New in version 3.7.

Deletes nodes in the graph. These nodes are also removed in the sub-graphs hierarchy of the current graph to maintain the sub-graph relation between graphs.

Parameters:
  • itNodes (a Tulip iterator on tlp.node objects) – an iterator on the nodes to add
  • deleteInAllGraphs (boolean) – if True, these nodes are deleted in the whole hierarchy of graphs.
Throws:

an exception if one of the node to delete is not an element of the graph.

tlp.Graph.addEdge(src, tgt)

Adds a new edge in the graph and returns it. This edge is also added in all the graph’s ancestors to maintain the sub-graph relation between graphs.

Parameters:
  • src (tlp.node) – the source node of the new edge
  • tgt (tlp.node) – the target node of the new edge
Return type:

tlp.edge

Throws:

an exception if the provided source or target node does not belong to the graph

tlp.Graph.addEdges(edges)

New in version 3.7.

Adds new edges in the graph and returns them in a list. The new edges are also added in all the graph ancestors to maintain the sub-graph relation between graphs.

Parameters:edges (list of tuples containing two tlp.node objects) – the list of edges to add described by a pair of nodes
Return type:list of tlp.edge
Throws:an exception if one of the provided nodes to link is not an element of the graph.
tlp.Graph.addEdge(edge)

Adds an existing edge in the graph. This edge is also added in all the graph’s ancestors to maintain the sub-graph relation between graphs.

Parameters:edge (tlp.edge) – an existing edge to add to the graph
Throws:an exception if the edge does not belong to the root graph of if the source and target node of the edge are not elements of the graph

Warning

The edge must be an element of the graph hierarchy, thus it must be an element of the root graph.

Warning

One can’t add an existing edge to the root graph.

tlp.Graph.addEdges(itEdges)

New in version 3.7.

Adds existing edges in the graph. The edges are also added in all the graph ancestors to maintain the sub-graph relation between graphs.

Parameters:itEdges (a Tulip iterator on tlp.edge objects) – an iterator on the edges to add
Throws:an exception if one of the edge to add is not an element of the root graph or if one of the edge extremities is not an element of the graph.

Warning

The added edges must be elements of the graph hierarchy, thus they must be elements of the root graph.

tlp.Graph.addEdges(list_edges)

New in version 4.5.

Adds existing edges in the graph. The edges are also added in all the graph ancestors to maintain the sub-graph relation between graphs.

Parameters:list_edges (a list of tlp.edge objects) – a list of edges to add
Throws:an exception if one of the edge to add is not an element of the root graph or if one of the edge extremities is not an element of the graph.

Warning

The added edges must be elements of the graph hierarchy, thus they must be elements of the root graph.

Warning

It is not possible to add existing edges to the root graph.

tlp.Graph.delEdge(edge[, deleteInAllGraphs = False])

Deletes an edge in the graph. This edge is also removed in all the sub-graphs of the graph to maintain the sub-graph relation between graphs. The ordering of edges is preserved.

Parameters:
  • edge (tlp.edge) – the edge to delete
  • deleteInAllGraphs (boolean) – if True, remove the edge in all the hierarchy of graphs
Throws:

an exception if the edge does not belong to the graph

tlp.Graph.delEdges(itEdges[, deleteInAllGraphs=False])

New in version 3.7.

Deletes edges in the graph. These edges are also removed in the sub-graphs hierarchy of the current graph to maintain the sub-graph relation between graphs. The ordering of the remaining edges is preserved.

Parameters:
  • itEdges (a Tulip iterator on tlp.edge objects) – an iterator on the edges to delete
  • deleteInAllGraphs – If True, the edges are deleted in the whole graph hierarchy.
  • deleteInAllGraphs – Boolean
Throws:

an exception if one of the edge to delete is not an element of the graph

tlp.Graph.delEdges(edges[, deleteInAllGraphs=False])

New in version 4.5.

Deletes edges in the graph. These edges are also removed in the sub-graphs hierarchy of the current graph to maintain the sub-graph relation between graphs.

Parameters:
  • edges (a list of tlp.edge objects) – a list of edges to delete
  • deleteInAllGraphs (Boolean) – if True, these edges are deleted in the whole graph hierarchy.
Throws:

an exception if one of the edge to delete is not an element of the graph

tlp.Graph.setEdgeOrder(node, edges)

Sets the order of the edges around a node. This operation ensures that adjacent edges of a node will be ordered as they are in the list of edges given in parameter.

Parameters:
  • node (tlp.node) – the node on which to set edges ordering
  • edges (list of tlp.edge) – the list of edges adjacent to the node
Throws:

an exception if the node does not belong to the graph

tlp.Graph.swapEdgeOrder(node, edge1, edge2)

Swaps two edges in the adjacency list of a node.

Parameters:
  • node (tlp.node) – the node on which swapping two edges in its adjacency list
  • edge1 (tlp.edge) – an edge adjacent to the node
  • edge2 (tlp.edge) – another edge adjacent to the node
Throws:

an exception if the node or one of the edges does not belong to the graph

tlp.Graph.setSource(edge, src)

Sets the source of an existing edge.

Parameters:
  • edge (tlp.edge) – the edge on which to change the source node
  • src (tlp.node) – the new source node of the edge
Throws:

an exception if the edge or the node does not belong to the graph

tlp.Graph.setTarget(edge, tgt)

Sets the target of an existing edge.

Parameters:
  • edge (tlp.edge) – the edge on which to change the target node
  • tgt (tlp.node) – the new target node of the edge
Throws:

an exception if the edge or node does not belong to the graph

tlp.Graph.setEnds(edge, src, tgt)

Sets both the source and target of an existing edge.

Parameters:
  • edge (tlp.edge) – the edge on which to change the source and target nodes
  • src (tlp.node) – the new source node of the edge
  • tgt (tlp.node) – the new target node of the edge
Throws:

an exception if the edge or one of the nodes does not belong to the graph

tlp.Graph.reverse(edge)

Reverses the direction of an edge, the source becomes the target and the target becomes the source.

Parameters:edge (tlp.edge) – the edge on which to revert the direction.
Throws:an exception if the edge does not belong to the graph

Warning

The ordering is global to the entire graph hierarchy. Thus, by changing the ordering in a graph you change the ordering in the hierarchy.

Creation and Modification of the sub-graph hierarchy

tlp.Graph.addSubGraph([selection = None, name = "unnamed"])

Creates and returns a new sub-graph. The elements of the new sub-graph are those selected in the selection. If there is no selection an empty sub-graph is returned.

Parameters:
  • selection (tlp.BooleanProperty) – a Boolean property whose selected elements will be added to the sub-graph
  • name (string) – The name of the newly created sub-graph. Defaults to “unnamed”.
Return type:

tlp.Graph

tlp.Graph.addSubGraph(name)

New in version 3.7.

Creates and returns a new named sub-graph of this graph.

Parameters:name (string) – The name of the newly created sub-graph.
Return type:tlp.Graph
tlp.Graph.addCloneSubGraph(name = "unnamed", addSibling = false, addSiblinProperties = false)

New in version 4.5.

Creates and returns a sub-graph of this graph (or the parent of this graph) that contains all its elements.

Parameters:
  • name (string) – The name of the newly created sub-graph. Defaults to “unnamed”.
  • addSibling (bool) – if true a sibling of this graph will be created; a sub-graph of this graph if not. Defaults to false
  • addSiblingProperties (bool) – if true all the local properties of this graph will be copied into its clone sibling. Defaults to false
Return type:

tlp.Graph

tlp.Graph.inducedSubGraph(nodeSet[, parentSubGraph])

Creates and returns a new sub-graph of the graph induced by a set of nodes. The sub-graph contains all the nodes from the set and all the existing edges between two nodes in the set including self-loops.

Parameters:
  • nodeSet (list or set of tlp.node) – the set of nodes from which to build the induced sub-graph
  • parentSubGraph (tlp.Graph) – If provided, is used as parent graph for the newly created sub-graph instead of the graph this method is called on.
Return type:

tlp.Graph

tlp.Graph.inducedSubGraph(selection[, parentSubGraph])

New in version 4.10.

Creates and returns a new sub-graph of the graph induced by a selection of nodes and edges. The sub-graph contains all the nodes of the set induced by the selected nodes but also the source and target nodes from the selected edges and all the existing edges between two nodes in the set including self-loops.

Parameters:
  • selection (tlp.BooleanProperty) – a selection of nodes and edges
  • parentSubGraph (tlp.Graph) – If provided, is used as parent graph for the newly created sub-graph instead of the graph this method is called on.
Return type:

tlp.Graph

tlp.Graph.delSubGraph(subgraph)

Delete a sub-graph of this graph. The sub-graph’s sub-graphs become sub-graphs of the graph.

Parameters:subgraph (tlp.Graph) – the sub-graph to remove
tlp.Graph.delAllSubGraphs(subgraph)

Delete a sub-graph of this graph and all its sub-graphs.

Parameters:subgraph (tlp.Graph) – the sub-graph to remove
tlp.Graph.getSuperGraph()

Returns the parent of the graph, if it has no parent (is the root graph), it returns itself.

Return type:tlp.Graph
tlp.Graph.getRoot()

Returns the root graph of the graph hierarchy.

Return type:tlp.Graph
tlp.Graph.setSuperGraph(superGraph)

Sets the parent of the graph (use very carefully). Standard users should never use this method.

Parameters:superGraph (tlp.Graph) – the new parent for the graph in the hierarchy.
tlp.Graph.getSubGraphs()

Returns an iterator on all the sub-graphs of the graph.

Return type:a Tulip iterator on tlp.Graph objects
tlp.Graph.isSubGraph(graph)

Returns True if the graph argument is a direct sub-graph of the graph.

Parameters:graph (tlp.Graph) – a graph
Return type:boolean
tlp.Graph.isDescendantGraph(graph)

Returns True if the graph argument is a descendant of this graph.

Parameters:graph (tlp.Graph) – a graph
Return type:boolean
tlp.Graph.getSubGraph(id)

Returns the sub-graph with the corresponding id or None if there is no sub-graph with that id.

Parameters:id (integer) – a graph id
Return type:tlp.Graph or None
tlp.Graph.getSubGraph(name)

New in version 3.7.

Returns the sub-graph with the corresponding name or None if there is no sub-graph with that name.

Parameters:name (string) – the name of the sub-graph to return
Return type:tlp.Graph or None
tlp.Graph.getDescendantGraph(id)

Returns the descendant graph with the corresponding id or None if there is no such descendant graph.

Parameters:id (integer) – a graph id
Return type:tlp.Graph or None
tlp.Graph.getDescendantGraph(name)

New in version 3.7.

Returns the descendant graph with the corresponding name or None if there is no such descendant graph.

Parameters:name (string) – the name of the descendant to return
Return type:tlp.Graph or None
tlp.Graph.getNthSubGraph(n)

New in version 3.7.

Returns the nth sub-graph or None if there is no such sub-graph. Since order cannot be ensured in every implementation, this method should be equivalent to:

i = 0
for sg in graph.getSubGraphs():
  if i++ == n:
    return sg
return None    
Parameters:n (integer) – the index of the sub-graph to return
Return type:tlp.Graph or None
tlp.Graph.numberOfSubGraphs()

New in version 3.7.

Returns the number of direct sub-graphs.

Return type:integer
tlp.Graph.numberOfDescendantGraphs()

New in version 3.7.

Returns the number of descendant graphs.

Return type:integer
tlp.Graph.getDescendantGraphs()

Returns an iterator over all the descendant graphs of the graph.

Return type:a Tulip iterator on tlp.Graph objects

Iterators on the graph structure

All the provided iterators are stable, meaning you can safely delete a node/edge/subgraph from the graph while iterating on its nodes/edges/subgraphs.

tlp.Graph.getOneNode()

Returns the first node in the graph.

Return type:tlp.node
tlp.Graph.getRandomNode()

New in version 4.8.

Returns a random node in the graph.

Return type:tlp.node
tlp.Graph.getNodes()

Returns an iterator on the nodes.

Return type:a Tulip iterator on tlp.node objects
tlp.Graph.getInNode(node, i)

Returns the ith predecessor of a node.

Parameters:
  • node (tlp.node) – an existing node of the graph
  • i (integer) – the position in the predecessor nodes list (warning : first index is 1 not 0)
Return type:

tlp.node

Throws:

an exception if the node does not belong to the graph or if the requested index is lesser than the number of predecessor nodes

tlp.Graph.getInNodes(node)

Return an iterator on the predecessors of a node.

Parameters:node (tlp.node) – an existing node of the graph
Return type:a Tulip iterator on tlp.node objects
Throws:an exception if the node does not belong to the graph
tlp.Graph.getOutNode(node, i)

Returns the ith successor of a node.

Parameters:
  • node (tlp.node) – an existing node of the graph
  • i (integer) – the position in the successor nodes list (warning : first index is 1 not 0)
Return type:

tlp.node

Throws:

an exception if the node does not belong to the graph or if the requested index is lesser than the number of successor nodes

tlp.Graph.getOutNodes(node)

Returns an iterator on the successors of a node.

Parameters:node (tlp.node) – an existing node of the graph
Return type:a Tulip iterator on tlp.node objects
Throws:an exception if the node does not belong to the graph
tlp.Graph.getInOutNodes(node)

Returns an iterator on the neighbours of a node.

Parameters:node (tlp.node) – an existing node of the graph
Return type:a Tulip iterator on tlp.node objects
Throws:an exception if the node does not belong to the graph
tlp.Graph.bfs([root])

New in version 4.2.

Returns an iterator performing a breadth-first search on the graph.

Parameters:root (tlp.node) – The node from whom to start the BFS. If not provided, the root node will be assigned to a source node in the graph (node with input degree equals to 0). If there is no source node in the graph, a random node will be picked.
Return type:a Tulip iterator on tlp.node objects in the BFS order.
Throws:an exception if the provided root node does not belong to the graph.
tlp.Graph.dfs([root])

New in version 4.2.

Returns an iterator performing a depth-first search on the graph.

Parameters:root (tlp.node) – The node from whom to start the DFS. If not provided, the root node will be assigned to a source node in the graph (node with input degree equals to 0). If there is no source node in the graph, a random node will be picked.
Return type:a Tulip iterator on tlp.node objects in the DFS order.
Throws:an exception if the provided root node does not belong to the graph.
tlp.Graph.getNodeMetaInfo(node)

Returns the underlying graph of a meta node.

Parameters:node (tlp.node) – an existing node of the graph
Return type:tlp.Graph
Throws:an exception if the node does not belong to the graph
tlp.Graph.getOneEdge()

Returns the first edge in the graph.

Return type:tlp.edge
tlp.Graph.getRandomEdge()

New in version 4.8.

Returns a random edge in the graph.

Return type:tlp.edge
tlp.Graph.getEdges()

Returns an iterator on the edges.

Return type:a Tulip iterator on tlp.edge objects
tlp.Graph.getOutEdges(node)

Returns a Tulip iterator on the outgoing edges of a node.

Parameters:node (tlp.node) – an existing node of the graph
Return type:a Tulip iterator on tlp.edge objects
Throws:an exception if the node does not belong to the graph
tlp.Graph.getInOutEdges(node)

Returns an iterator on the incoming and outgoing edges of a node.

Parameters:node (tlp.node) – an existing node of the graph
Return type:a Tulip iterator on tlp.edge objects
Throws:an exception if the node does not belong to the graph
tlp.Graph.getInEdges(node)

Returns an iterator on the incoming edges of a node.

Parameters:node (tlp.node) – an existing node of the graph
Return type:a Tulip iterator on tlp.edge objects
Throws:an exception if the node does not belong to the graph
tlp.Graph.getEdgeMetaInfo(edge)

Returns an iterator on the underlying edges of a meta edge.

Parameters:edge (tlp.edge) – an existing edge of the graph
Return type:a Tulip iterator on tlp.edge objects
Throws:an exception if the edge does not belong to the graph

Information about the graph stucture

tlp.Graph.getId()

Returns the graph’s id. This id is unique.

Return type:integer
tlp.Graph.getName()

Returns the name of the graph.

Return type:string
tlp.Graph.setName(name)

Sets the name of the graph.

Parameters:name (string) – the new name of the graph
tlp.Graph.getAttributes()

New in version 4.4.

Returns all the attributes of the graph.

Return type:a dictionnary with string keys filled with graph attributes values
tlp.Graph.getAttribute(name)

Returns a reference on an attribute of the graph or None if it does not exist.

Parameters:name (string) – the name of the attribute to return.
Return type:object
Throws:an exception is the attribute does not exist
tlp.Graph.setAttribute(name, val)

Sets an attribute of the graph.

Parameters:
  • name (string) – the name of the attribute to set
  • val – the value of the attribute
  • type – object
tlp.Graph.removeAttribute(name)

New in version 4.4.

Removes an attribute of the graph.

Parameters:name (string) – the name of the attribute to return.
Return type:object
Throws:an exception is the attribute does not exist
tlp.Graph.existAttribute(name)

New in version 4.10.

Checks if an attribute with a specific name exists in the graph.

Parameters:name (string) – the name of the attribute to test existence.
Return type:boolean
tlp.Graph.attributeExist(name)

New in version 4.4.

Deprecated since version 4.10.

Checks if an attribute with a specific name exists in the graph. That method is now deprecated, use tlp.Graph.existAttribute() instead.

Parameters:name (string) – the name of the attribute to test existence.
Return type:boolean
tlp.Graph.numberOfNodes()

Returns the number of nodes in the graph.

Return type:integer
tlp.Graph.numberOfEdges()

Returns the number of edges in the graph.

Return type:integer
tlp.Graph.deg(node)

Returns the degree of a node.

Parameters:node (tlp.node) – an existing node of the graph
Return type:integer
Throws:an exception if the node does not belong to the graph
tlp.Graph.indeg(node)

Returns the incoming degree of a node.

Parameters:node (tlp.node) – an existing node of the graph
Return type:integer
Throws:an exception if the node does not belong to the graph
tlp.Graph.outdeg(node)

Returns the outgoing degree of a node.

Parameters:node (tlp.node) – an existing node of the graph
Return type:integer
Throws:an exception if the node does not belong to the graph
tlp.Graph.source(edge)

Returns the source of the edge.

Parameters:edge (tlp.edge) – an existing edge of the graph
Return type:tlp.node
Throws:an exception if the edge does not belong to the graph
tlp.Graph.target(edge)

Returns the target of the edge.

Parameters:edge (tlp.edge) – an existing edge of the graph
Return type:tlp.node
Throws:an exception if the edge does not belong to the graph
tlp.Graph.ends(edge)

Returns a tuple containing the two end nodes of an edge

Parameters:edge – an existing edge of the graph
Return type:(tlp.node, tlp.node)
Throws:an exception if the edge does not belong to the graph
tlp.Graph.opposite(edge, node)

Returns the opposite node of the edge for the given node.

Parameters:edge (tlp.edge) – an existing edge of the graph
Return type:tlp.node
Throws:an exception if the edge does not belong to the graph or if the given node is not linked by the edge
tlp.Graph.isElement(node)

Returns True if the node is an element of the graph.

Parameters:node (tlp.node) – a node
Return type:boolean
tlp.Graph.isMetaNode(node)

Returns True if the node is a meta-node.

Parameters:node (tlp.edge) – an existing node of the graph
Return type:boolean
Throws:an exception if the node does not belong to the graph
tlp.Graph.isElement(edge)

Returns True if the edge is an element of the graph.

Parameters:edge (tlp.edge) – an edge
Return type:boolean
tlp.Graph.isElement(node)
Parameters:node (tlp.node) – a node
Return type:boolean
tlp.Graph.isMetaEdge(edge)

Returns True if the edge is a meta-edge.

Parameters:edge – an existing edge of the graph
Return type:boolean
Throws:an exception if the edge does not belong to the graph
tlp.Graph.existEdge(node1, node2[, directed=True])

Returns the first edge found between two nodes. If no edge is found, returns an invalid edge.

Parameters:
  • node1 (tlp.node) – an existing node of the graph
  • node2 (tlp.node) – an existing node of the graph
  • directed (boolean) – indicates if the direction of the edge (from source to target) must be taken in to account
Return type:

tlp.edge

Throws:

an exception if one of the nodes does not belong to the graph

tlp.Graph.getSource()

New in version 3.7.

Finds the first node whose input degree equals 0. Returns the found node (invalid if there is no source);

Return type:tlp.node

Create/Access graph properties

tlp.Graph.getBooleanProperty(name)

Returns the boolean property associated to name in the graph properties pool or in the pool of an ancestor in the sub-graphs hierarchy. If the property is not registered in the pool, it creates a new one and returns it. Using of del on that property will cause a segmentation violation (use tlp.Graph.delLocalProperty() instead).

Parameters:name (string) – the name of the boolean property to return or to create
Return type:tlp.BooleanProperty
tlp.Graph.getLocalBooleanProperty(name)

Returns the boolean property associated to name in the graph properties pool. If the property is not registered in the pool, it creates a new one and returns it. Using of del on that property will cause a segmentation violation (use tlp.Graph.delLocalProperty() instead).

Parameters:name (string) – the name of the boolean property to return or to create
Return type:tlp.BooleanProperty
tlp.Graph.getBooleanVectorProperty(name)

Returns the boolean vector property associated to name in the graph properties pool or in the pool of an ancestor in the sub-graphs hierarchy. If the property is not registered in the pool, it creates a new one and returns it. Using of del on that property will cause a segmentation violation (use tlp.Graph.delLocalProperty() instead).

Parameters:name (string) – the name of the boolean vector property to return or to create
Return type:tlp.BooleanVectorProperty
tlp.Graph.getLocalBooleanVectorProperty(name)

Returns the boolean vector property associated to name in the graph properties pool. If the property is not registered in the pool, it creates a new one and returns it. Using of del on that property will cause a segmentation violation (use tlp.Graph.delLocalProperty() instead).

Parameters:name (string) – the name of the boolean vector property to return or to create
Return type:tlp.BooleanVectorProperty
tlp.Graph.getColorProperty(name)

Returns the color property associated to name in the graph properties pool or in the pool of an ancestor in the sub-graphs hierarchy. If the property is not registered in the pool, it creates a new one and returns it. Using of del on that property will cause a segmentation violation (use tlp.Graph.delLocalProperty() instead).

Parameters:name (string) – the name of the color property to return or to create
Return type:tlp.ColorProperty
tlp.Graph.getLocalColorProperty(name)

Returns the color property associated to name in the graph properties pool. If the property is not registered in the pool, it creates a new one and returns it. Using of del on that property will cause a segmentation violation (use tlp.Graph.delLocalProperty() instead).

Parameters:name (string) – the name of the color property to return or to create
Return type:tlp.ColorProperty
tlp.Graph.getColorVectorProperty(name)

Returns the color vector property associated to name in the graph properties pool or in the pool of an ancestor in the sub-graphs hierarchy. If the property is not registered in the pool, it creates a new one and returns it. Using of del on that property will cause a segmentation violation (use tlp.Graph.delLocalProperty() instead).

Parameters:name (string) – the name of the color vector property to return or to create
Return type:tlp.ColorVectorProperty
tlp.Graph.getLocalColorVectorProperty(name)

Returns the color vector property associated to name in the graph properties pool. If the property is not registered in the pool, it creates a new one and returns it. Using of del on that property will cause a segmentation violation (use tlp.Graph.delLocalProperty() instead).

Parameters:name (string) – the name of the color vector property to return or to create
Return type:tlp.ColorVectorProperty
tlp.Graph.getDoubleProperty(name)

Returns the double property associated to name in the graph properties pool or in the pool of an ancestor in the sub-graphs hierarchy. If the property is not registered in the pool, it creates a new one and returns it. Using of del on that property will cause a segmentation violation (use tlp.Graph.delLocalProperty() instead).

Parameters:name (string) – the name of the double property to return or to create
Return type:tlp.DoubleProperty
tlp.Graph.getLocalDoubleProperty(name)

Returns the double property associated to name in the graph properties pool. If the property is not registered in the pool, it creates a new one and returns it. Using of del on that property will cause a segmentation violation (use tlp.Graph.delLocalProperty() instead).

Parameters:name (string) – the name of the double property to return or to create
Return type:tlp.DoubleProperty
tlp.Graph.getDoubleVectorProperty(name)

Returns the double vector property associated to name in the graph properties pool or in the pool of an ancestor in the sub-graphs hierarchy. If the property is not registered in the pool, it creates a new one and returns it. Using of del on that property will cause a segmentation violation (use tlp.Graph.delLocalProperty() instead).

Parameters:name (string) – the name of the double vector property to return or to create
Return type:tlp.DoubleVectorProperty
tlp.Graph.getLocalDoubleVectorProperty(name)

Returns the double vector property associated to name in the graph properties pool. If the property is not registered in the pool, it creates a new one and returns it. Using of del on that property will cause a segmentation violation (use tlp.Graph.delLocalProperty() instead).

Parameters:name (string) – the name of the double vector property to return or to create
Return type:tlp.DoubleVectorProperty
tlp.Graph.getIntegerProperty(name)

Returns the integer property associated to name in the graph properties pool or in the pool of an ancestor in the sub-graphs hierarchy. If the property is not registered in the pool, it creates a new one and returns it. Using of del on that property will cause a segmentation violation (use tlp.Graph.delLocalProperty() instead).

Parameters:name (string) – the name of the integer property to return or to create
Return type:tlp.IntegerProperty
tlp.Graph.getLocalIntegerProperty(name)

Returns the integer property associated to name in the graph properties pool. If the property is not registered in the pool, it creates a new one and returns it. Using of del on that property will cause a segmentation violation (use tlp.Graph.delLocalProperty() instead).

Parameters:name (string) – the name of the integer property to return or to create
Return type:tlp.IntegerProperty
tlp.Graph.getIntegerVectorProperty(name)

Returns the integer vector property associated to name in the graph properties pool or in the pool of an ancestor in the sub-graphs hierarchy. If the property is not registered in the pool, it creates a new one and returns it. Using of del on that property will cause a segmentation violation (use tlp.Graph.delLocalProperty() instead).

Parameters:name (string) – the name of the integer vector property to return or to create
Return type:tlp.IntegerVectorProperty
tlp.Graph.getLocalIntegerVectorProperty(name)

Returns the integer vector property associated to name in the graph properties pool. If the property is not registered in the pool, it creates a new one and returns it. Using of del on that property will cause a segmentation violation (use tlp.Graph.delLocalProperty() instead).

Parameters:name (string) – the name of the integer vector property to return or to create
Return type:tlp.IntegerVectorProperty
tlp.Graph.getGraphProperty(name)

Returns the meta-graph property associated to name in the graph properties pool or in the pool of an ancestor in the sub-graphs hierarchy. If the property is not registered in the pool, it creates a new one and returns it. Using of del on that property will cause a segmentation violation (use tlp.Graph.delLocalProperty() instead).

Parameters:name (string) – the name of the meta-graph property to return or to create
Return type:tlp.GraphProperty
tlp.Graph.getLocalGraphProperty(name)

Returns the meta-graph property associated to name in the graph properties pool. If the property is not registered in the pool, it creates a new one and returns it. Using of del on that property will cause a segmentation violation (use tlp.Graph.delLocalProperty() instead).

Parameters:name (string) – the name of the meta-graph property to return or to create
Return type:tlp.GraphProperty
tlp.Graph.getLayoutProperty(name)

Returns the layout property associated to name in the graph properties pool or in the pool of an ancestor in the sub-graphs hierarchy. If the property is not registered in the pool, it creates a new one and returns it. Using of del on that property will cause a segmentation violation (use tlp.Graph.delLocalProperty() instead).

Parameters:name (string) – the name of the layout property to return or to create
Return type:tlp.LayoutProperty
tlp.Graph.getLocalLayoutProperty(name)

Returns the layout property associated to name in the graph properties pool. If the property is not registered in the pool, it creates a new one and returns it. Using of del on that property will cause a segmentation violation (use tlp.Graph.delLocalProperty() instead).

Parameters:name (string) – the name of the layout property to return or to create
Return type:tlp.LayoutProperty
tlp.Graph.getCoordVectorProperty(name)

Returns the coord vector property associated to name in the graph properties pool or in the pool of an ancestor in the sub-graphs hierarchy. If the property is not registered in the pool, it creates a new one and returns it. Using of del on that property will cause a segmentation violation (use tlp.Graph.delLocalProperty() instead).

Parameters:name (string) – the name of the coord vector property to return or to create
Return type:tlp.CoordVectorProperty
tlp.Graph.getLocalCoordVectorProperty(name)

Returns the coord vector property associated to name in the graph properties pool. If the property is not registered in the pool, it creates a new one and returns it. Using of del on that property will cause a segmentation violation (use tlp.Graph.delLocalProperty() instead).

Parameters:name (string) – the name of the coord vector property to return or to create
Return type:tlp.CoordVectorProperty
tlp.Graph.getSizeProperty(name)

Returns the size property associated to name in the graph properties pool or in the pool of an ancestor in the sub-graphs hierarchy. If the property is not registered in the pool, it creates a new one and returns it. Using of del on that property will cause a segmentation violation (use tlp.Graph.delLocalProperty() instead).

Parameters:name (string) – the name of the size property to return or to create
Return type:tlp.SizeProperty
tlp.Graph.getLocalSizeProperty(name)

Returns the size property associated to name in the graph properties pool. If the property is not registered in the pool, it creates a new one and returns it. Using of del on that property will cause a segmentation violation (use tlp.Graph.delLocalProperty() instead).

Parameters:name (string) – the name of the size property to return or to create
Return type:tlp.SizeProperty
tlp.Graph.getSizeVectorProperty(name)

Returns the size vector property associated to name in the graph properties pool or in the pool of an ancestor in the sub-graphs hierarchy. If the property is not registered in the pool, it creates a new one and returns it. Using of del on that property will cause a segmentation violation (use tlp.Graph.delLocalProperty() instead).

Parameters:name (string) – the name of the size vector property to return or to create
Return type:tlp.SizeVectorProperty
tlp.Graph.getLocalSizeVectorProperty(name)

Returns the size vector property associated to name in the graph properties pool. If the property is not registered in the pool, it creates a new one and returns it. Using of del on that property will cause a segmentation violation (use tlp.Graph.delLocalProperty() instead).

Parameters:name (string) – the name of the size vector property to return or to create
Return type:tlp.SizeVectorProperty
tlp.Graph.getStringProperty(name)

Returns the string property associated to name in the graph properties pool or in the pool of an ancestor in the sub-graphs hierarchy. If the property is not registered in the pool, it creates a new one and returns it. Using of del on that property will cause a segmentation violation (use tlp.Graph.delLocalProperty() instead).

Parameters:name (string) – the name of the string property to return or to create
Return type:tlp.StringProperty
tlp.Graph.getLocalStringProperty(name)

Returns the string property associated to name in the graph properties pool. If the property is not registered in the pool, it creates a new one and returns it. Using of del on that property will cause a segmentation violation (use tlp.Graph.delLocalProperty() instead).

Parameters:name (string) – the name of the string property to return or to create
Return type:tlp.StringProperty
tlp.Graph.getStringVectorProperty(name)

Returns the string vector property associated to name in the graph properties pool or in the pool of an ancestor in the sub-graphs hierarchy. If the property is not registered in the pool, it creates a new one and returns it. Using of del on that property will cause a segmentation violation (use tlp.Graph.delLocalProperty() instead).

Parameters:name (string) – the name of the string vector property to return or to create
Return type:tlp.StringVectorProperty
tlp.Graph.getLocalStringVectorProperty(name)

Returns the string vector property associated to name in the graph properties pool. If the property is not registered in the pool, it creates a new one and returns it. Using of del on that property will cause a segmentation violation (use tlp.Graph.delLocalProperty() instead).

Parameters:name (string) – the name of the string vector property to return or to create
Return type:tlp.StringVectorProperty
tlp.Graph.getProperty(name)

Returns the property associated to name in the graph properties pool. The returned property is referenced by its base class tlp.PropertyInterface meaning getting and setting values can only be done via the use of strings. To get the property correctly typed, use the methods described above. If the property does not exist it returns None.

Parameters:name (string) – the name of the property to return
Return type:tlp.PropertyInterface
tlp.Graph.existProperty(name)

Returns True if a property of that name exists in the graph properties pool or in the pool of an ancestor in the sub-graphs hierarchy.

Parameters:name (string) – the name of the property
Return type:boolean
tlp.Graph.existLocalProperty(name)

Returns True if a property of that name exists in the graph properties pool.

Parameters:name (string) – the name of the property
Return type:boolean
tlp.Graph.delLocalProperty(name)

Removes and deletes the property associated to name in the graph properties pool.

Parameters:name (string) – the name of the property to delete
tlp.Graph.getLocalProperties()

Returns an iterator on the names of the properties local to the graph.

Return type:a Tulip iterator on string objects
tlp.Graph.getInheritedProperties()

Returns an iterator on the names of the properties inherited from the graph’s ancestors.

Return type:a Tulip iterator on string objects
tlp.Graph.getProperties()

Returns an iterator on the names of all the properties attached to the graph.

Return type:a Tulip iterator on string objects
tlp.Graph.getLocalObjectProperties()

New in version 4.8.

Returns an iterator over the local properties attached to the graph.

Return type:a Tulip iterator on tlp.PropertyInterface objects
tlp.Graph.getInheritedObjectProperties()

New in version 4.8.

Returns an iterator over the inherited properties attached to the graph.

Return type:a Tulip iterator on tlp.PropertyInterface objects
tlp.Graph.getObjectProperties()

New in version 4.8.

Returns an iterator over the properties attached to the graph, whether they are local or inherited.

Return type:a Tulip iterator on tlp.PropertyInterface objects
tlp.Graph.getNodePropertiesValues(node)

New in version 4.8.1.

Returns a dictionnary containing the attached graph properties values for a given node. The keys of that dictionnary are of string type and corresponds to the graph properties names while the values are typed according to those of the properties (bool, int, float, str, tlp.Color, tlp.Coord, tlp.Size, list of those types).

Parameters:node (tlp.node) – a node of the graph
Return type:a dictionnary filled with the node properties values
Throws:an exception if the provided node does not belong to the graph
tlp.Graph.getEdgePropertiesValues(edge)

New in version 4.8.1.

Returns a dictionnary containing the attached graph properties values for a given edge. The keys of that dictionnary are of string type and corresponds to the graph properties names while the values are typed according to those of the properties (bool, int, float, str, tlp.Color, tlp.Coord, tlp.Size, list of those types).

Parameters:edge (tlp.edge) – an edge of the graph
Return type:a dictionnary filled with the edge properties values :throws: an exception if the provided node does not belong to the graph
tlp.Graph.setNodePropertiesValues(node, propertiesValues)

New in version 4.8.1.

Sets the values of multiple graph properties for a given node through the use of a dictionnary. The keys of that dictionnary must be of string type and must correspond to existing graph properties names while the values must be typed according to those of the properties (bool, int, float, str, tlp.Color, tlp.Coord, tlp.Size, list of those types).

Parameters:
  • node (tlp.node) – a node of the graph
  • propertiesValues (a dictionnary) – the properties values for the node
Throws:

an exception if the provided node does not belong to the graph, if one of the string key of the dictionnary does not correspond to an existing property name of if there is a type error for a property value

tlp.Graph.setEdgePropertiesValues(edge, propertiesValues)

New in version 4.8.1.

Sets the values of multiple graph properties for a given edge through the use of a dictionnary. The keys of that dictionnary must be of string type and must correspond to existing graph properties names while the values must be typed according to those of the properties (bool, int, float, str, tlp.Color, tlp.Coord, tlp.Size, list of those types).

Parameters:
  • edge (tlp.edge) – an edge of the graph
  • propertiesValues (a dictionnary) – the properties values for the edge
Throws:

an exception if the provided edge does not belong to the graph, if one of the string key of the dictionnary does not correspond to an existing property name of if there is a type error for a property value

Application of algorithms

tlp.Graph.applyAlgorithm(algoName[, params])

New in version 3.7.

Applies an algorithm plugin, identified by its name. Algorithm plugins are objects implementing the tlp::Algorithm interface in C++ or the tlp.Algorithm interface in Python.

Parameters can be transmit to the algorithm using a Python dictionnary filled with parameters values where keys are of type string (parameters names) . In some cases, algorithms can also use this dictionnary in order to return some external information. To determine a plugin’s parameters, you can either:

Returns a tuple whose first member is a boolean indicating if the algorithm terminates successfully and second member is a string which can contain an error message.

Parameters:
  • algoName (string) – The name of the algorithm to apply.
  • params (a dictionnary with string keys (parameters names) and parameters values) – The parameters to the algorithm.
Return type:

(boolean, string)

tlp.Graph.applyBooleanAlgorithm(algoName, result[, params = None])

New in version 3.8.

Computes a boolean property on the current graph using an external named boolean algorithm (plugin). Boolean algorithm plugins are objects implementing the tlp::BooleanAlgorithm interface in C++ or the tlp.BooleanAlgorithm interface in Python. The list of currently loaded boolean algorithm plugins can be retrieved through the tlp.getBooleanAlgorithmPluginsList() function. The computed values will be stored in result.

Parameters can be transmit to the algorithm using a Python dictionnary filled with parameters values where keys are of type string (parameters names) . In some cases, algorithms can also use this dictionnary in order to return some external information (not stored in result). To determine a plugin’s parameters, you can either:

Returns a tuple whose first member is a boolean indicating if the algorithm terminates successfully and second member is a string which can contain an error message.

Parameters:
  • algoName (string) – the name of the boolean algorithm to call
  • result (tlp.BooleanProperty) – a boolean property in which result of the algorithm will be stored
  • params (a dictionnary with string keys (parameters names) and parameters values) – The parameters to the algorithm.
Return type:

(boolean, string)

Throws:

an exception if the requested boolean algorithm plugin is not registered in the plugins database.

Warning

Previous values stored in result will be deleted.

tlp.Graph.applyBooleanAlgorithm(algoName[, params = None])

New in version 4.8.

Convenient method that computes a boolean property on the current graph and stores the result in the default boolean property “viewSelection”. This is equivalent to call:

graph.applyBooleanAlgorithm(algoName, graph.getBooleanProperty("viewSelection"), params)
tlp.Graph.applyColorAlgorithm(algoName, result[, params = None])

New in version 3.8.

Computes a color property on the current graph using an external named color algorithm (plugin). Color algorithm plugins are objects implementing the tlp::ColorAlgorithm interface in C++ or the tlp.ColorAlgorithm interface in Python. The list of currently loaded color algorithm plugins can be retrieved through the tlp.getColorAlgorithmPluginsList() function. The computed values will be stored in result.

Parameters can be transmit to the algorithm using a Python dictionnary filled with parameters values where keys are of type string (parameters names) . In some cases, algorithms can also use this dictionnary in order to return some external information (not stored in result). To determine a plugin’s parameters, you can either:

Returns a tuple whose first member is a boolean indicating if the algorithm terminates successfully and second member is a string which can contain an error message.

Parameters:
  • algoName (string) – the name of the color algorithm to call
  • result (tlp.ColorProperty) – a color property in which result of the algorithm will be stored
  • params (a dictionnary with string keys (parameters names) and parameters values) – The parameters to the algorithm.
Return type:

(boolean, string)

Throws:

an exception if the requested color algorithm plugin is not registered in the plugins database.

Warning

Previous values stored in result will be deleted.

tlp.Graph.applyColorAlgorithm(algoName[, params = None])

New in version 4.8.

Convenient method that computes a color property on the current graph and stores the result in the default color property “viewColor”. This is equivalent to call:

graph.applyColorAlgorithm(algoName, graph.getColorProperty("viewColor"), params)
tlp.Graph.applyDoubleAlgorithm(algoName, result[, params = None])

New in version 3.8.

Computes a double property on the current graph using an external named double algorithm (plugin). Double algorithm plugins are objects implementing the tlp::DoubleAlgorithm interface in C++ or the tlp.DoubleAlgorithm interface in Python. The list of currently loaded double algorithm plugins can be retrieved through the tlp.getDoubleAlgorithmPluginsList() function. The computed values will be stored in result.

Parameters can be transmit to the algorithm using a Python dictionnary filled with parameters values where keys are of type string (parameters names) . In some cases, algorithms can also use this dictionnary in order to return some external information (not stored in result). To determine a plugin’s parameters, you can either:

Returns a tuple whose first member is a boolean indicating if the algorithm terminates successfully and second member is a string which can contain an error message.

Parameters:
  • algoName (string) – the name of the double algorithm to call
  • result (tlp.DoubleProperty) – a double property in which result of the algorithm will be stored
  • params (a dictionnary with string keys (parameters names) and parameters values) – The parameters to the algorithm.
Return type:

(boolean, string)

Throws:

an exception if the requested double algorithm plugin is not registered in the plugins database.

Warning

Previous values stored in result will be deleted.

tlp.Graph.applyDoubleAlgorithm(algoName[, params = None])

New in version 4.8.

Convenient method that computes a double property on the current graph and stores the result in the default double property “viewMetric”. This is equivalent to call:

graph.applyDoubleAlgorithm(algoName, graph.getDoubleProperty("viewMetric"), params)
tlp.Graph.applyIntegerAlgorithm(algoName, result[, params = None])

New in version 3.8.

Computes an integer property on the current graph using an external named integer algorithm (plugin). Integer algorithm plugins are objects implementing the tlp::IntegerAlgorithm interface in C++ or the tlp.IntegerAlgorithm interface in Python. The list of currently loaded integer algorithm plugins can be retrieved through the tlp.getIntegerAlgorithmPluginsList() function. The computed values will be stored in result.

Parameters can be transmit to the algorithm using a Python dictionnary filled with parameters values where keys are of type string (parameters names) . In some cases, algorithms can also use this dictionnary in order to return some external information (not stored in result). To determine a plugin’s parameters, you can either:

Returns a tuple whose first member is a boolean indicating if the algorithm terminates successfully and second member is a string which can contain an error message.

Parameters:
  • algoName (string) – the name of the integer algorithm to call
  • result (tlp.IntegerProperty) – an integer property in which result of the algorithm will be stored
  • params (a dictionnary with string keys (parameters names) and parameters values) – The parameters to the algorithm.
Return type:

(boolean, string)

Throws:

an exception if the requested integer algorithm plugin is not registered in the plugins database.

Warning

Previous values stored in result will be deleted.

tlp.Graph.applyLayoutAlgorithm(algoName, result[, params = None])

New in version 3.8.

Computes a layout property on the current graph using an external named layout algorithm (plugin). Layout algorithm plugins are objects implementing the tlp::LayoutAlgorithm interface in C++ or the tlp.LayoutAlgorithm interface in Python. The list of currently loaded layout algorithm plugins can be retrieved through the tlp.getLayoutAlgorithmPluginsList() function. The computed values will be stored in result.

Parameters can be transmit to the algorithm using a Python dictionnary filled with parameters values where keys are of type string (parameters names) . In some cases, algorithms can also use this dictionnary in order to return some external information (not stored in result). To determine a plugin’s parameters, you can either:

Returns a tuple whose first member is a boolean indicating if the algorithm terminates successfully and second member is a string which can contain an error message.

Parameters:
  • algoName (string) – the name of the layout algorithm to call
  • result (tlp.LayoutProperty) – a layout property in which result of the algorithm will be stored
  • params (a dictionnary with string keys (parameters names) and parameters values) – The parameters to the algorithm.
Return type:

(boolean, string)

Throws:

an exception if the requested layout algorithm plugin is not registered in the plugins database.

Warning

Previous values stored in result will be deleted.

tlp.Graph.applyLayoutAlgorithm(algoName[, params = None])

New in version 4.8.

Convenient method that computes a layout property on the current graph and stores the result in the default layout property “viewLayout”. This is equivalent to call:

graph.applyLayoutAlgorithm(algoName, graph.getLayoutProperty("viewLayout"), params)
tlp.Graph.applySizeAlgorithm(algoName, result[, params = None])

New in version 3.8.

Computes a size property on the current graph using an external named size algorithm (plugin). Size algorithm plugins are objects implementing the tlp::SizeAlgorithm interface in C++ or the tlp.SizeAlgorithm interface in Python. The list of currently loaded size algorithm plugins can be retrieved through the tlp.getSizeAlgorithmPluginsList() function. The computed values will be stored in result.

Parameters can be transmit to the algorithm using a Python dictionnary filled with parameters values where keys are of type string (parameters names) . In some cases, algorithms can also use this dictionnary in order to return some external information (not stored in result). To determine a plugin’s parameters, you can either:

Returns a tuple whose first member is a boolean indicating if the algorithm terminates successfully and second member is a string which can contain an error message.

Parameters:
  • algoName (string) – the name of the size algorithm to call
  • result (tlp.SizeProperty) – a size property in which result of the algorithm will be stored
  • params (a dictionnary with string keys (parameters names) and parameters values) – The parameters to the algorithm.
Return type:

(boolean, string)

Throws:

an exception if the requested size algorithm plugin is not registered in the plugins database.

Warning

Previous values stored in result will be deleted.

tlp.Graph.applySizeAlgorithm(algoName[, params = None])

New in version 4.8.

Convenient method that computes a size property on the current graph and stores the result in the default size property “viewSize”. This is equivalent to call:

graph.applySizeAlgorithm(algoName, graph.getSizeProperty("viewSize"), params)
tlp.Graph.applyStringAlgorithm(algoName, result[, params = None])

New in version 3.8.

Computes a string property on the current graph using an external named string algorithm (plugin). String algorithm plugins are objects implementing the tlp::StringAlgorithm interface in C++ or the tlp.StringAlgorithm interface in Python. The list of currently loaded string algorithm plugins can be retrieved through the tlp.getStringAlgorithmPluginsList() function. The computed values will be stored in result. Parameters can be transmit to the algorithm using a Python dictionnary filled with parameters values where keys are of type string (parameters names) . In some cases, algorithms can also use this dictionnary in order to return some external information (not stored in result). To determine a plugin’s parameters, you can either:

Returns a tuple whose first member is a boolean indicating if the algorithm terminates successfully and second member is a string which can contain an error message.

Parameters:
  • algoName (string) – the name of the string algorithm to call
  • result (tlp.StringProperty) – a string property in which result of the algorithm will be stored
  • params (a dictionnary with string keys (parameters names) and parameters values) – The parameters to the algorithm.
Return type:

(boolean, string)

Throws:

an exception if the requested string algorithm plugin is not registered in the plugins database.

Warning

Previous values stored in result will be deleted.

tlp.Graph.applyStringAlgorithm(algoName[, params = None])

New in version 4.8.

Convenient method that computes a string property on the current graph and stores the result in the default string property “viewLabel”. This is equivalent to call:

graph.applyStringAlgorithm(algoName, graph.getStringProperty("viewLabel"), params)

Update management

tlp.Graph.push([unpopAllowed=True])

Marks the state of the current root graph in thehiss=rc root graph in afsninf nageme stored inrberrer alg return so inundoin&#trc r ninf tlp.StringProh" titlcl with the

Parameters:
    a dwed=Truea dictionstring)8211; The paramIfemb:

    ss="xref py py-class docuonst literal">tlp.StrinFalsecode> with, of thinf nageme scouldstere inrbplayr aafpansundoin.mIfemnal palues sconundoinvnageme sexrrenof yscouldste l>a ans inrbplayr .r>
    tlp.Graph.push([unpopAllowed=True])

    Marks theRee resula palues sconmsta algoe current root graph in thehi s=rc root graph imeterre resultgoe cudoeistered mror msta able class="docutils field-list" frame="void" rules="none"> Parameters:

      a dwed=Truea dictionstring)8211; The paramIfemb:

      ss="xref py py-class docuonst literal">tlp.StrinFalsecode> with, of tundoin&nageme scouldstere inrbplayr .r>
      tlp.Graph.push()

      Marks the stateagairent graph andgoe current rh in thehisot graph s thrbplaysut algosf nageme spalues sconundoiniv>

      tlp.Graph.push()

      Marks theReuple wss="xref py py-class docuonst literal">tlp.Strin interface fla palues sconmsta algoe cuansmit re resulble class="docutils field-list" frame="void" rules="none"> Parameterpe:

      tlp.Graph.push()

      Marks theReuple wss="xref py py-class docuonst literal">tlp.Strin interface flmnal palues sconundoin&nageme scnsmit replayr .r> class="docutils field-list" frame="void" rules="none"> Parameterpe:

      tlp.Graph.push()

      Marks theReuple wss="xref py py-class docuonst literal">tlp.Strin interface flnt graph andgoe cunageme scnsmit undoin&nt n replayr .r> class="docutils field-list" frame="void" rules="none"> Parameterpe:

      Update maMdta-nrfasnt

      Updermalink to this headline">¶

      tlp.Graph.push(algoName[, params = multiEdges>])

      Marks theClosng proealgorexrrerty nrfasninefia o class="docutils field-list" frame="void" rules="none"> Parameters:

      • algoNamea dicoealgor"reference internal" href="#tulip.tlp.StringPronrfaaermalink.StringPronrfaaass="xref py py-class docutils literal">tlp.StringPronrfapade>) – a string prurrentrroealgorexrrerty nrfas>paramsa dictionstring)8211; The paramg if thasnifia paramsa dictionstring)8211; The paramg if thasnifiof tundrefyrty edge stored inrbmogh tidom of e tlrroot graph l> Return type:

        (boolean,"reference internal" href="#tulip.tlp.StringPronrfaaermalink.StringPronrfaaass="xref py py-class docutils literal">tlp.StringPronrfapade>) –> Throws:

        anption if the requeoin&ugina gorithmgde>

        Warning

        Previous quivaat comptoredfailys an

      tlp.Graph.push(algoName)

      Marks thePopuleme sp an> Parameters:

      • paramsa dica TGrap span mtrrrre"reference internal" href="#tulip.tlp.StringProode>tlp.StringProGn>) –implemen a string prthehisspan mtr, (>paramstlp.StringProGn>) – an integec rothehisutes toredn error of Return type:

        (boolea excepturrently"reference internal" href="#tulip.tlp.StringPronrfaaermalink.StringPronrfaaass="xref py py-class docutils literal">tlp.StringPronrfapade>) –>

        tlp.Graph.push(algoName[, params = nageme/span>])

        Marks theOpensia Parameters:

          gosf
        • paramstlp.StringPronrfapade>) – a string of open>paramsa dictionstring)8211; The paramIfess="xref py py-class docuonst literal">tlp.Strin interfac,>open&

          Warning

          Previous quivaat comptoredfailys an

="section" id="update-ma.Stri-

>TGrap

>
="section" id="update-ma.lp-vec3fdate magProVec3f"headerlink" href="#tulip.tlp.lp-vec3fdermalink to this headline">¶
thod"="tulip.tlp.Graph.appVec3fdateemre">tlp.Stcode clautils n class="descclassname">tlp.Graph.push¶

Marks thequivautils rbpresd tsia vecmtrrng ke3 floemhon poil:

p>Numers stmaStrot soperan>wnsllu
graph# Istantieme twoevecmtrs/pre>paramsparamso">=span class="n">params.getStringVec3f"dn class="p">(()
paramsmfda1.0/pre>)
paramsmfda3.0/pre>)
paramsparamso">=span class="n">params.getStringVec3f"dn class="p">(() paramsmfda2.0/pre>) paramsmfda6.0/pre>) graph# A>operantrr+=sng his tvails="d/pre>paramsparamso">=span class="n">paramsparamso">+span class="n">paramsgraph# A>iredn stl c ts ofia vecmtr,>operantrr+=sng his tvails="d/pre>paramsparamso">=span class="n">paramsparamso">+span class="n">paramsmfda2.0/pre>graph# Subema="enwoevecmtrs,>operantrr-=sng his tvails="d/pre>paramsparamso">=span class="n">paramsparamso">-span class="n">paramsgraph# Subema="eaiored l/p>iredn stl c ts ofia vecmtr,>operantrr-=sng his tvails="d/pre>paramsparamso">=span class="n">paramsparamso">-span class="n">paramsmfda3.0/pre>graph# Multiplyenwoevecmtrs ed invecmtrrStcduct),>operantrr*=sng his tvails="d/pre>paramsparamso">=span class="n">paramsparamso">*span class="n">paramsgraph# Multiplyeeach n stl c t ofia vecmtrrby aiored ,>operantrr*=sng his tvails="d/pre>paramsparamso">=span class="n">paramsparamso">*span class="n">paramsmfda2.0/pre>graph# Dividercwoevecmtrs,>operantrr/=sng his tvails="d/pre>paramsparamso">=span class="n">paramsparamso">/span class="n">paramsgraph# Dividereach n stl c t ofia vecmtrrby aiored ,>operantrr/=sng his tvails="d/pre>paramsparamso">=span class="n">paramsparamso">/span class="n">paramsmfda2.0/pre>graph# to (noia vecmtrrStcduct,>operantrr^=sng his tvails="d/pre>paramsparamso">=span class="n">paramsparamso">^span class="n">params
p>Each n stl c t ofiStrioecmtrrcnsmit read / writtensut operantrv class="highlight-python">
graphparamso">=span class="n">params.getStringVec3f"dn class="p">(()
paramsmfda2.0/pre>)
paramsmfda3.0/pre>)
graph# read onition stl c t/pre>paramsparamso">=span class="n">params) ["dn class="p">(0/pre>) ]/pre>graph# writctionrd n stl c t/pre>params) ["dn class="p">(2/pre>) ]/pre>paramso">=span class="n">paramsmfda4.0/pre>
p>Operantrsshtrrvecmtrs equthity (==),>vecmtrs difnternal"(!=ametervecmtrs n starison (<, >)npe sthis tvails="dcodlass=method">
()

Marks theC method that com. tuple wStrinonrd n stl c t ofiStrioecmtrParametss="docutils field-list" frame="void" rules="none"> Parameterpe:

(algoName)

Marks theC string p thrbuple wlt stistancesbetweensutrioecmtrr(3d poil:ameterano Parameters: