Hi,
Me, being that I know Gremlin (http://gremlin.tinkerpop.com), would do this in
Gremlin as such:
m = [:]
g.v(1).out('like').in('like').except([g.v(1)]).groupCount(m)
This is basic collaborative filtering. The statement reads,
1. create the map m
2. starting at vertex with id 1
3. traverse the outgoing likes edges to products
4. traverse the incoming likes edges to people
5. remove the self as I don't want to say I'm similar to myself.
6. count the amount of people I've arrived it over shared product likes
(store in m)
7. m is your resultant map. to rank it, do:
m.sort{a,b -> a.value <=> b.value}
There are numerous variations of this theme that you can expand on from this
core.
Hope that helps,
Marko.
http://markorodriguez.com
On Jun 23, 2011, at 7:30 AM, Rick Otten wrote:
> I have a graph of a bunch of people who are not connected to each other,
> but instead connected to things they "like". I'd like to start with one
> person, and find a list of people have the 'most in common' with them.
>
> Ideally I'd like to be able to prioritize the things they like, for
> example, it is more important to find people who like live in the same
> town, than people who liked the same movie.
>
> One approach is to traverse each 'like', one at a time, in order of
> importance, and then do a bunch of Set intersections on the results, and
> then return the list of people in reverse order.
>
> Is there a way to do this without having to run a whole bunch of queries?
>
>
>
> --
> Rick Otten
> [email protected]
> O=='=+
>
>
> _______________________________________________
> Neo4j mailing list
> [email protected]
> https://lists.neo4j.org/mailman/listinfo/user
_______________________________________________
Neo4j mailing list
[email protected]
https://lists.neo4j.org/mailman/listinfo/user