# ``igraph`.`operators`.`methods``

module documentation
(source)

Undocumented

Function | `__add__` | Copies the graph and extends the copy depending on the type of the other object given.
Function | `__and__` | Graph intersection operator.
Function | `__iadd__` | In-place addition (disjoint union).
Function | `__isub__` | In-place subtraction (difference).
Function | `__mul__` | Copies exact replicas of the original graph an arbitrary number of times.
Function | `__or__` | Graph union operator.
Function | `__sub__` | Removes the given object(s) from the graph
Function | `_disjoint_union` | Creates the disjoint union of two (or more) graphs.
Function | `_intersection` | Creates the intersection of two (or more) graphs.
Function | `_union` | Creates the union of two (or more) graphs.

def __add__(graph, other): (source)

Copies the graph and extends the copy depending on the type of the other object given.

Parameters
graph | Undocumented
other | if it is an integer, the copy is extended by the given number of vertices. If it is a string, the copy is extended by a single vertex whose `name` attribute will be equal to the given string. If it is a tuple with two elements, the copy is extended by a single edge. If it is a list of tuples, the copy is extended by multiple edges. If it is a `Graph`, a disjoint union is performed.

def __and__(graph, other): (source)

Graph intersection operator.

Parameters
graph | Undocumented
other | the other graph to take the intersection with.

Returns
the intersected graph.

def __iadd__(graph, other): (source)

In-place addition (disjoint union).

See Also
`__add__`

def __isub__(graph, other): (source)

In-place subtraction (difference).

See Also
`__sub__`

def __mul__(graph, other): (source)

Copies exact replicas of the original graph an arbitrary number of times.

Parameters
graph | Undocumented
other | if it is an integer, multiplies the graph by creating the given number of identical copies and taking the disjoint union of them.

def __or__(graph, other): (source)

Graph union operator.

Parameters
graph | Undocumented
other | the other graph to take the union with.

Returns
the union graph.

def __sub__(graph, other): (source)

Removes the given object(s) from the graph

Parameters
graph | Undocumented
other | if it is an integer, removes the vertex with the given ID from the graph (note that the remaining vertices will get re-indexed!). If it is a tuple, removes the given edge. If it is a graph, takes the difference of the two graphs. Accepts lists of integers or lists of tuples as well, but they can't be mixed! Also accepts `Edge` and `EdgeSeq` objects.

def _disjoint_union(graph, other): (source)

Creates the disjoint union of two (or more) graphs.

Parameters
graph | Undocumented
other | graph or list of graphs to be united with the current one.

Returns
the disjoint union graph

def _intersection(graph, other, byname='auto'): (source)

Creates the intersection of two (or more) graphs.

Parameters
graph | Undocumented
other | graph or list of graphs to be intersected with the current one.
byname | whether to use vertex names instead of ids. See `igraph.operators.intersection` for details.

Returns
the intersection graph

def _union(graph, other, byname='auto'): (source)

Creates the union of two (or more) graphs.

Parameters
graph | Undocumented
other | graph or list of graphs to be united with the current one.
byname | whether to use vertex names instead of ids. See `igraph.operators.union` for details.

Returns
the union graph