Skip to content

Commit

Permalink
minor docstring fix (dmlc#910)
Browse files Browse the repository at this point in the history
  • Loading branch information
BarclayII authored Oct 8, 2019
1 parent 3ee7e11 commit a1cdc7a
Showing 1 changed file with 19 additions and 11 deletions.
30 changes: 19 additions & 11 deletions python/dgl/heterograph.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,7 @@ class DGLHeteroGraph(object):
{rank=sink; Nintendo; Mojang}
}
One can analyze the graph and figure out the metagraph as follows:
.. graphviz::
digraph G {
User -> User [label=follows]
User -> Game [label=plays]
Developer -> Game [label=develops]
}
Suppose that one maps the users, games and developers to the following
And suppose that one maps the users, games and developers to the following
IDs:
========= ===== === =====
Expand Down Expand Up @@ -158,6 +148,24 @@ class DGLHeteroGraph(object):
>>> g['plays'].number_of_nodes() # ERROR!! There are two types 'user' and 'game'.
>>> g['plays'].number_of_edges() # OK!! because there is only one edge type 'plays'
Metagraph
---------
For each heterogeneous graph, one can often infer the *metagraph*, the template of
edge connections showing how many types of nodes and edges exist in the graph, and
how each edge type could connect between node types.
One can analyze the example gameplay graph above and figure out the metagraph as
follows:
.. graphviz::
digraph G {
User -> User [label=follows]
User -> Game [label=plays]
Developer -> Game [label=develops]
}
Parameters
----------
gidx : HeteroGraphIndex
Expand Down

0 comments on commit a1cdc7a

Please sign in to comment.