Skip to content

Instantly share code, notes, and snippets.

@BrianLitwin
Last active February 20, 2019 18:03
Show Gist options
  • Save BrianLitwin/51348d13dd2861fbe12f9491ba25025e to your computer and use it in GitHub Desktop.
Save BrianLitwin/51348d13dd2861fbe12f9491ba25025e to your computer and use it in GitHub Desktop.
* - direction: one of Direction.IN, direction.OUT, or Direction.ANY.
  *   - Direction.IN finds neigbhors where root is the destination of the
  *     edge.
  *   - Direction.OUT finds neigbhors where root is the source of the edge.
  *   - Direction.ANY finds neigbhors where root is the source or destination
  *     of the edge.
  *
 if (edge.src === target) {
        relevantEdgeWeight += weightedEdge.weight.froWeight;
      }
      if (edge.dst === target) {
        relevantEdgeWeight += weightedEdge.weight.toWeight;
      }

assuming that you're asking for a node's incoming neighbors ...

what if you are asking for outgoing?

=> signature of graph.neighbors

  *_neighbors(
    node: NodeAddressT,
    options: NeighborsOptions,
    initialModificationCount: ModificationCount
  ):

this.totalOutWeight(node); => shouldn't this be target ?

  • hot take:

  • called 'nodes' 'scoredNodes'

  • call edges 'weightedEdges'

  • I thought outweights were normalized by the markov chain distr. bc they were a prob distribution => or is that the total score going out of the node?

  • nit: refer to "Neighbors from graph" to this as "graph.neighbors"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment