python-igraph manual

For using igraph from Python

   Home       Trees       Indices       Help   
Package igraph :: Class Edge
[hide private]

Class Edge

source code

object --+
         |
        Edge

Class representing a single edge in a graph.

The edge is referenced by its index, so if the underlying graph changes, the semantics of the edge object might change as well (if the edge indices are altered in the original graph).

The attributes of the edge can be accessed by using the edge as a hash:

>>> e["weight"] = 2                  #doctest: +SKIP
>>> print e["weight"]                #doctest: +SKIP
2
Instance Methods [hide private]
 
__delitem__(x, y)
del x[y]
source code
 
__eq__(x, y)
x==y
source code
 
__ge__(x, y)
x>=y
source code
 
__getitem__(x, y)
x[y]
source code
 
__gt__(x, y)
x>y
source code
 
__hash__(x)
hash(x)
source code
 
__le__(x, y)
x<=y
source code
 
__len__(x)
len(x)
source code
 
__lt__(x, y)
x<y
source code
 
__ne__(x, y)
x!=y
source code
 
__repr__(x)
repr(x)
source code
 
__setitem__(x, i, y)
x[i]=y
source code
list
attribute_names()
Returns the list of edge attribute names
source code
dict
attributes()
Returns a dict of attribute names and values for the edge
source code
 
count_multiple(...)
Proxy method to Graph.count_multiple()
source code
 
delete(...)
Proxy method to Graph.delete_edges()
source code
 
is_loop(...)
Proxy method to Graph.is_loop()
source code
 
is_multiple(...)
Proxy method to Graph.is_multiple()
source code
 
is_mutual(...)
Proxy method to Graph.is_mutual()
source code
None
update_attributes(E, **F)
Updates the attributes of the edge from dict/iterable E and F.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __init__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]
  graph
The graph the edge belongs to
  index
Index of this edge
  source
Source node index of this edge
  target
Target node index of this edge
  tuple
Source and target node index of this edge as a tuple

Inherited from object: __class__

Method Details [hide private]

__hash__(x)
(Hashing function)

source code 

hash(x)

Overrides: object.__hash__

__repr__(x)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__

count_multiple(...)

source code 

Proxy method to Graph.count_multiple()

This method calls the count_multiple method of the Graph class with this edge as the first argument, and returns the result.

See Also: Graph.count_multiple() for details.

delete(...)

source code 

Proxy method to Graph.delete_edges()

This method calls the delete_edges method of the Graph class with this edge as the first argument, and returns the result.

See Also: Graph.delete_edges() for details.

is_loop(...)

source code 

Proxy method to Graph.is_loop()

This method calls the is_loop method of the Graph class with this edge as the first argument, and returns the result.

See Also: Graph.is_loop() for details.

is_multiple(...)

source code 

Proxy method to Graph.is_multiple()

This method calls the is_multiple method of the Graph class with this edge as the first argument, and returns the result.

See Also: Graph.is_multiple() for details.

is_mutual(...)

source code 

Proxy method to Graph.is_mutual()

This method calls the is_mutual method of the Graph class with this edge as the first argument, and returns the result.

See Also: Graph.is_mutual() for details.

update_attributes(E, **F)

source code 

Updates the attributes of the edge from dict/iterable E and F.

If E has a keys() method, it does: for k in E: self[k] = E[k]. If E lacks a keys() method, it does: for (k, v) in E: self[k] = v. In either case, this is followed by: for k in F: self[k] = F[k].

This method thus behaves similarly to the update() method of Python dictionaries.

Returns: None

   Home       Trees       Indices       Help