The 5 Graphs of Love

2,699 views

Published on

Recorded webinar: neotechnology.com/webinar-five-graphs-love

The iDating industry cares about interactions and connections. Those two concepts are closely linked. If someone has a connection to another person, through a shared friend or a shared interest, they are much more likely to interact. Graph databases are optimized for querying connections between people, things, interests, or really anything that can be connected.

Dating sites and apps worldwide have begun to use graph databases to achieve competitive gain. Neo4j provides thousand-fold performance improvements and massive agility benefits over relational databases, enabling new levels of performance and insight. Amanda Laucher discusses the five graphs of love, and how companies like eHarmony, Hinge and AreYouInterested.com, are now using graph algorithms to create more interactions and connections.

Published in: Technology
0 Comments
9 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,699
On SlideShare
0
From Embeds
0
Number of Embeds
36
Actions
Shares
0
Downloads
64
Comments
0
Likes
9
Embeds 0
No embeds

No notes for slide

The 5 Graphs of Love

  1. 1. (Neo4j)-[:POWERS] ->(Love) Amanda Laucher Neo Technology @pandamonial 1
  2. 2. Most of your favorite dating sites 2
  3. 3. The 5 Graphs of Love 3
  4. 4. The 5 Graphs of Love • The Friends-of-Friends Graph ! ! ! ! ! ! ! 4
  5. 5. The 5 Graphs of Love • The Friends-of-Friends Graph ! • The Passion Graph ! ! ! ! ! 5
  6. 6. The 5 Graphs of Love • The Friends-of-Friends Graph ! • The Passion Graph ! • The Location Graph ! ! ! 6
  7. 7. The 5 Graphs of Love • The Friends-of-Friends Graph ! • The Passion Graph ! • The Location Graph ! • The Safety Graph ! 7
  8. 8. The 5 Graphs of Love • The Friends-of-Friends Graph ! • The Passion Graph ! • The Location Graph ! • The Safety Graph ! • The Poser Graph 8
  9. 9. Meet Jeremy... ๏ from: California ๏ appearance: very handsome ๏ personality: super friendly nerd ๏ interests: piano, coding Jeremy
  10. 10. Jeremy has some friends ๏ Kerstin: his sister ๏ Peter: his buddy ๏ Andreas: his coworker Peter Andreas Jeremy Kerstin
  11. 11. His friends introduced more friends ๏ Michael: master hacker, divorced, 2 kids ๏ Johan: technology sage, likes fast cars ๏ Madelene: polyglot journalist, loves dogs ๏ Allison: marketing maven, likes long walks on the beach Michael Peter Andreas Johan Jeremy Madelene Allison Kerstin
  12. 12. So, we have a bunch of people ๏ how do we know they are friends? ๏ either ask each pair: are you friends? ๏ or, we can add explicit connections ๏ Twitter, Facebook, LinkedIn, etc. Michael Peter Andreas Johan Jeremy Madelene Allison Kerstin
  13. 13. This is really just data ๏ it's just a graph Michael Peter Johan Jeremy Allison Anna Andreas Madelene Kerstin Adam
  14. 14. A graph? 14
  15. 15. Yes, a graph... ๏ you know the common data structures •linked lists, trees, object "graphs" ๏ a graph is the general purpose data structure •suitable for any connected data ๏ well-understood patterns and algorithms •studied since Leonard Euler's 7 Bridges (1736) •Codd's Relational Model (1970) •not a new idea, just an idea who's time is now 15
  16. 16. How can you use this? With a Graph Database 16
  17. 17. A graph database... ๏ optimized for the connections between records ๏ really, really fast at querying across records ๏ a database: transactional with the usual operations ๏ “A relational database may tell you 
 the average age of everyone here, but a graph database will tell you 
 who is most likely to buy you a beer later.” 17
  18. 18. What’s love got to do with it? 18
  19. 19. Friends of Friends Graph 19
  20. 20. According to SNAP Interactive if you are a ! female user, you have a: ๏ 4% likelihood of interacting with a stranger ๏ 10% likelihood of interacting with friend of friend ๏ 7% chance of interacting with 3rd degree connection (friend of friend of friend) ๏ Connections mean a much larger number of interactions! Michael Peter Johan Jeremy Allison Anna Andreas Madelene Jennifer Adam
  21. 21. Friends of friends = larger dating pool 21
  22. 22. Friends Andreas Peter Jennifer Jeremy
  23. 23. Friends of friends Jeremy Peter Andreas Amanda Johan Jeremy Allison Frank Madelene Jennifer
  24. 24. Friends of friends of friends
  25. 25. Find Jeremy’s FoFs 25
  26. 26. Demo - Find who Jeremy shares the most friends with 26
  27. 27. Complicated Relationships Andreas :WORKS_FOR :FRIENDS :FRIENDS Peter Jake Jennifer
  28. 28. Friends :WANTS_TO_DATE Andreas :WORKS_FOR :FRIENDS :FRIENDS Peter Jake Jennifer
  29. 29. Friends :WANTS_TO_DATE Andreas :WORKS_FOR :FRIENDS :FRIENDS Peter Jake Jennifer Awkward!!
  30. 30. Friends of Friends :WANTS_TO_DATE :WANTS_TO_DATE Andreas :WORKS_FOR :FRIENDS :FRIENDS Peter Jennifer Jake Awkward
  31. 31. Friends of Friends :WANTS_TO_DATE :WANTS_TO_DATE Andreas :WORKS_FOR :FRIENDS :FRIENDS Peter Jennifer Jake :NO_DATE Too complex!
  32. 32. Friends of Friends of Friends :WANTS_TO_DATE :WANTS_TO_DATE :WORKS_FOR :FRIENDS :FRIENDS Andreas :WANTS_TO_DATE Peter Jennifer Jake :NO_DATE :NO_DATE :WANTS_TO_DATE
  33. 33. Friends of Friends of Friends
  34. 34. Friends of Friends of Friends
  35. 35. Meet Jon... ๏ from: UK ๏ seeking: Females ๏ appearance: Hot, hot, hot! ๏ personality: Fun loving, easy going ๏ interests: cooking, chemistry Jon
  36. 36. Location Graph 36
  37. 37. Jon wants to find a date and refuses to have a long distance relationship 37
  38. 38. Location Graph *Neo4j Spatial 38
  39. 39. Passion Graph 39
  40. 40. Jon wants to find someone he can share his passions with. 40
  41. 41. Match Specific Interests :REPORTED_INTEREST Jon Cooking
  42. 42. Match Specific Interests :REPORTED_INTEREST Jon
  43. 43. Match Specific Interests :REPORTED_INTEREST Jon Anne Julia Jennifer
  44. 44. Safety Graph 44
  45. 45. Jon uses social networks Jon
  46. 46. Let’s dig into his Twitter
  47. 47. He follows some strange people
  48. 48. …and tweets about strange things!
  49. 49. Some basic word analysis
  50. 50. Let’s update based on behavior :DEMONSTRATED_INTEREST Jon
  51. 51. Any ladies ok with this?
  52. 52. Any ladies ok with this? Jennifer Jane Maria
  53. 53. Passion Graph 53
  54. 54. Jon loves the New England Patriots :HAS_INTEREST Jon 54
  55. 55. :IS_A :IS_A Sports :IS_A :IS_A 55
  56. 56. Sports :IS_A :IS_A :IS_A :IS_A :HAS_TEAM :HAS_TEAM :HAS_TEAM :HAS_TEAM :HAS_TEAM 56
  57. 57. Sports :IS_A :IS_A :IS_A :IS_A :HAS_TEAM :HAS_TEAM :HAS_TEAM :HAS_TEAM :HAS_TEAM Jon 57
  58. 58. Sports Jon 58
  59. 59. Find ladies who like football 59
  60. 60. Find ladies who like football Katie Jennifer Greta 60
  61. 61. Poser Graph 61
  62. 62. Jon has no luck with online dating. All of his interactions are with spam profiles. 62
  63. 63. Find real people with at least 1 social network & minimum 2 posts 63
  64. 64. Find ladies who aren’t spam bots 64
  65. 65. Put it all together 65
  66. 66. Find Jon’s perfect date 66
  67. 67. Jon :PERFECT_FOR Jennifer 67
  68. 68. Jon :HAS_DATE_WITH Jennifer 68
  69. 69. Jon & Jennifer delete their profiles and go off into the sunset! Jon Jennifer 69
  70. 70. [:POWERS] [:AIDS] [:AIDS] Love [:AIDS] [:FOUND] [:AIDS] [:AIDS] Jon Jennifer
  71. 71. (Neo4j)-[:POWERS] ->(Love) Amanda Laucher Neo Technology 71
  72. 72. Performance Challenges with Connected Data RDBMS/Other vs. Native Graph Database Response Time 1000x faster # Hops: Tens to Hundreds Degree: Thousands+ Size: Billions+ # Hops: 0-2 Degree: < 3 Size: Thousands RDBMS / Other NOSQL Neo4j Connectedness of Data Set
  73. 73. Neo4j Adoption Snapshot Select Commercial Customers* (some NDA) Core Industries & Use Cases: Software Financial Services Core Industries Use Cases: Network & Data & Center Management Telecommu nications Health Care & Life Sciences Web / ISV Web Social, HR & Recruiting Financial Services Media & Publishing Energy, Services, Automotive, Gov’t, Logistics, Education, Gaming, Other Telecommunications MDM / System of Record Network & Data Center Management Social Geo Accenture Master Data Management Recommend-ations Identity & Access Mgmt Social Content Management Aviation Geo BI, CRM, Impact Analysis, Fraud Detection, Resource Optimization, etc. *Community Users Not Included Neo Technology, Inc Confidential
  74. 74. Graph Database Deployment Ad-hoc visual navigation & discovery End User Graph-
 Dashboards
 &
 Ad-hoc
 Analysis
 Graph Visualization Application Other Databases Reporting Bulk Analytic Infrastructure ETL ETL Graph Database Cluster (e.g. Graph Compute Engine) Graph Mining & Aggregation Ad-Hoc
 Analysis Data Storage &
 Business Rules Execution Data Scientist Neo Technology, Inc Confidential
  75. 75. Experiencing Query Pain Actual HR Query* (in SQL) (SELECT T.directReportees AS directReportees, sum(T.count) AS count FROM ( SELECT manager.pid AS directReportees, 0 AS count FROM person_reportee manager WHERE manager.pid = (SELECT id FROM person WHERE name = "fName lName") UNION SELECT manager.pid AS directReportees, count(manager.directly_manages) AS count FROM person_reportee manager WHERE manager.pid = (SELECT id FROM person WHERE name = "fName lName") GROUP BY directReportees UNION SELECT manager.pid AS directReportees, count(reportee.directly_manages) AS count FROM person_reportee manager JOIN person_reportee reportee ON manager.directly_manages = reportee.pid WHERE manager.pid = (SELECT id FROM person WHERE name = "fName lName") GROUP BY directReportees UNION SELECT manager.pid AS directReportees, count(L2Reportees.directly_manages) AS count FROM person_reportee manager JOIN person_reportee L1Reportees ON manager.directly_manages = L1Reportees.pid JOIN person_reportee L2Reportees ON L1Reportees.directly_manages = L2Reportees.pid WHERE manager.pid = (SELECT id FROM person WHERE name = "fName lName") GROUP BY directReportees ) AS T GROUP BY directReportees) UNION (SELECT T.directReportees AS directReportees, sum(T.count) AS count FROM ( SELECT manager.directly_manages AS directReportees, 0 AS count FROM person_reportee manager WHERE manager.pid = (SELECT id FROM person WHERE name = "fName lName") UNION SELECT reportee.pid AS directReportees, count(reportee.directly_manages) AS count FROM person_reportee manager JOIN person_reportee reportee ON manager.directly_manages = reportee.pid WHERE manager.pid = (SELECT id FROM person WHERE name = "fName lName") GROUP BY directReportees UNION (continued from previous page...) SELECT depth1Reportees.pid AS directReportees, count(depth2Reportees.directly_manages) AS count FROM person_reportee manager JOIN person_reportee L1Reportees ON manager.directly_manages = L1Reportees.pid JOIN person_reportee L2Reportees ON L1Reportees.directly_manages = L2Reportees.pid WHERE manager.pid = (SELECT id FROM person WHERE name = "fName lName") GROUP BY directReportees ) AS T GROUP BY directReportees) UNION (SELECT T.directReportees AS directReportees, sum(T.count) AS count FROM( SELECT reportee.directly_manages AS directReportees, 0 AS count FROM person_reportee manager JOIN person_reportee reportee ON manager.directly_manages = reportee.pid WHERE manager.pid = (SELECT id FROM person WHERE name = "fName lName") GROUP BY directReportees UNION SELECT L2Reportees.pid AS directReportees, count(L2Reportees.directly_manages) AS count FROM person_reportee manager JOIN person_reportee L1Reportees ON manager.directly_manages = L1Reportees.pid JOIN person_reportee L2Reportees ON L1Reportees.directly_manages = L2Reportees.pid WHERE manager.pid = (SELECT id FROM person WHERE name = "fName lName") GROUP BY directReportees ) AS T GROUP BY directReportees) UNION (SELECT L2Reportees.directly_manages AS directReportees, 0 AS count FROM person_reportee manager JOIN person_reportee L1Reportees ON manager.directly_manages = L1Reportees.pid JOIN person_reportee L2Reportees ON L1Reportees.directly_manages = L2Reportees.pid WHERE manager.pid = (SELECT id FROM person WHERE name = "fName lName") ) ! *“Find all direct reports and how many they manage, up to 3 levels down”
  76. 76. Experiencing Query Pain Same Query*, using Cypher MATCH  (boss)-­‐[:MANAGES*0..3]-­‐>(sub),              (sub)-­‐[:MANAGES*1..3]-­‐>(report)   WHERE  boss.name  =  “John  Doe”   RETURN  sub.name  AS  Subordinate,  count(report)  AS  Total *“Find all direct reports and how many they manage, up to 3 levels down”

×