Created by freemso on 17-3-14.
Graph
01 Syntax
02 Methods
| Name | Overloads | Summary |
|---|---|---|
| preprocess | 1 | pre-processing of transition probabilities for guiding the random walks |
| computeAliasEdge | 1 | to compute the alias method for an edge |
| walk | 1 | random walk in the graph starting from a node |
| simulateWalks | 1 | simulation of a bunch of walks |
| sortedNeighborList | 1 | get a node's neighbors in a sorted list the set of the neighbors of node is defined as {x|node-->x} sort the nodes according to its ids |
| hasEdge | 1 | check whether there is an edge between two nodes note that all the edges in the graph are directive |
| getEdge | 1 | get the edge between two nodes |
| addEdge | 1 | add a new edge to the graph if such an edge already exists, update the weight note that all the edges in the graph are directed if the graph is not directed, we just simply add… |
| addNode | 1 | add a node with the id to the graph if such a node already exists, return it and do nothing if not, create a new node, add it to the graph and return it |
03 Members
pre-processing of transition probabilities for guiding the random walks
VertexEdge)to compute the alias method for an edge
| Name | Type | Description |
|---|---|---|
edge | VertexEdge | the edge to compute |
the node2vec.AliasMethod object that store distribution information
Int32, Vertex)random walk in the graph starting from a node
| Name | Type | Description |
|---|---|---|
walkLength | Int32 | the steps of this walk |
startNode | Vertex | the start node of this walk |
the path that we pass, expressed as a Node List
Int32, Int32)simulation of a bunch of walks
| Name | Type | Description |
|---|---|---|
numWalks | Int32 | iteration times |
walkLength | Int32 | steps of every walk |
the list of paths that we've walked
Vertex)get a node's neighbors in a sorted list the set of the neighbors of node is defined as {x|node-->x} sort the nodes according to its ids
| Name | Type | Description |
|---|---|---|
node | Vertex | the node |
a sorted list of nodes
Vertex, Vertex)check whether there is an edge between two nodes note that all the edges in the graph are directive
| Name | Type | Description |
|---|---|---|
src | Vertex | node1 |
dst | Vertex | node2 |
true is there is an edge
Vertex, Vertex)get the edge between two nodes
| Name | Type | Description |
|---|---|---|
src | Vertex | node1 |
dst | Vertex | node2 |
the edge, null is not exist such an edge
Vertex, Vertex, Double)add a new edge to the graph if such an edge already exists, update the weight note that all the edges in the graph are directed if the graph is not directed, we just simply add two directed edges with the opposite directions that connect two nodes
| Name | Type | Description |
|---|---|---|
src | Vertex | first node of the edge |
dst | Vertex | second node of the edge |
weight | Double | of the edge |
Int32, String)add a node with the id to the graph if such a node already exists, return it and do nothing if not, create a new node, add it to the graph and return it
| Name | Type | Description |
|---|---|---|
id | Int32 | the id of the node |
the node found