node-graph-suggestions
Provides "people you should follow" or other graph-based recommendations. By calling the suggest method and providing two data fetching methods for looking up forward connections (ie "users followed by a user") and reverse connections (ie "users following a user") you can get back a list of suggested friends, products, or any other concept that can be represented as a graph.
Installation
Use NPM to install:
npm install graph-suggestions
Usage
A simple example showing the behavior of the forwardOnly option.
var suggestions = ; var DATA_STORE = Andrew: friends: 'Ben' Ben: friends: 'Andrew' 'Chuck' Chuck: friends: 'Ben' Dennis: friends: 'Andrew' ; var opts = forwardOnly: true forwardConnections: forwardFetcher ;suggestions; opts = forwardConnections: forwardFetcher reverseConnections: reverseFetcher ;suggestions; { var node = DATA_STOREnodeID; ;} { var array = ; for var curNodeID in DATA_STORE var node = DATA_STOREcurNodeID; if nodefriends !== -1 array; ;}