Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dgl
Commits
a1cdc7a5
"docs/source/git@developer.sourcefind.cn:OpenDAS/dgl.git" did not exist on "17f863569e45a0cc2da9955985fe9a63c0b6ab14"
Unverified
Commit
a1cdc7a5
authored
Oct 08, 2019
by
Quan (Andy) Gan
Committed by
GitHub
Oct 08, 2019
Browse files
minor docstring fix (#910)
parent
3ee7e112
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
11 deletions
+19
-11
python/dgl/heterograph.py
python/dgl/heterograph.py
+19
-11
No files found.
python/dgl/heterograph.py
View file @
a1cdc7a5
...
@@ -49,17 +49,7 @@ class DGLHeteroGraph(object):
...
@@ -49,17 +49,7 @@ class DGLHeteroGraph(object):
{rank=sink; Nintendo; Mojang}
{rank=sink; Nintendo; Mojang}
}
}
One can analyze the graph and figure out the metagraph as follows:
And suppose that one maps the users, games and developers to the following
.. 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
IDs:
IDs:
========= ===== === =====
========= ===== === =====
...
@@ -158,6 +148,24 @@ class DGLHeteroGraph(object):
...
@@ -158,6 +148,24 @@ class DGLHeteroGraph(object):
>>> g['plays'].number_of_nodes() # ERROR!! There are two types 'user' and 'game'.
>>> 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'
>>> 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
Parameters
----------
----------
gidx : HeteroGraphIndex
gidx : HeteroGraphIndex
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment