Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions doc/source/tutorial/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -309,11 +309,11 @@ Traverse all the edges using an edge iterator:
>>> for EI in G2.Edges():
>>> print("edge (%d, %d)" % (EI.GetSrcNId(), EI.GetDstNId()))

Traverse the edges by traversing nodes and getting all their neighbors:
Traverse the edges by traversing nodes and getting all their out-neighbors:

>>> for NI in G2.Nodes():
>>> for Id in NI.GetOutEdges():
>>> print("edge (%d %d)" % (NI.GetId(), Id))
>>> for e in range(NI.GetOutDeg()):
>>> print("edge (%d %d)" % (NI.GetId(), NI.GetOutNId(e)))

Node iterators provide several useful methods:

Expand All @@ -322,6 +322,8 @@ Node iterators provide several useful methods:
* GetInDeg(): returns in-degree of a node
* GetOutNId(e): returns node id of the endpoint of e-th out-edge
* GetInNId(e): returns node id of the endpoint of e-th in-edge
* GetOutEdges(): returns generator of node ids of the endpoints of out-edges
* GetInEdges(): returns generator of node ids of the endpoints of in-edges
* IsOutNId(n): tests if there is an out-edge to node n
* IsInNId(n): tests if there is an in-edge from node n
* IsNbrNId(n): tests if node n is a neighbor
Expand Down
3 changes: 3 additions & 0 deletions doc/todo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ Apr 20, 2016

- Implement a method in TNEANet to return a list of edges between two nodes

- Implement a method in all graph types to return the graph adjacency matrix as a sparse matrix

- Implement a method in all graph types to return the graph incidence matrix as a sparse matrix