SlideShare a Scribd company logo
Graph Gurus
Episode 11
Using Accumulators in GSQL
for Complex Graph Analytics
© 2019 TigerGraph. All Rights Reserved
Welcome
● Attendees are muted
● If you have any Zoom issues please contact the panelists via chat
● We will have 10 min for Q&A at the end so please send your questions
at any time using the Q&A tab in the Zoom menu
● The webinar will be recorded and sent via email
2
© 2019 TigerGraph. All Rights Reserved
Developer Edition Available
We now offer Docker versions and VirtualBox versions of the TigerGraph
Developer Edition, so you can now run on
● MacOS
● Windows 10
● Linux
Developer Edition Download https://www.tigergraph.com/developer/
3
Version 2.3
Released Today
© 2019 TigerGraph. All Rights
Reserved
Today's Gurus
4
Victor Lee
Director of Product Management
● BS in Electrical Engineering and Computer Science
from UC Berkeley, MS in Electrical Engineering from
Stanford University
● PhD in Computer Science from Kent State University
focused on graph data mining
● 15+ years in tech industry
Gaurav Deshpande
Vice President of Marketing
● Built out and positioned IBM’s Big Data and Analytics
portfolio, driving 45 percent year-over-year growth.
● Led 2 startups through explosive growth - i2
Technologies (IPO) & Trigo Technologies (largest MDM
acquisition by IBM)
● Big Data Analytics Veteran, 14 patents in supply chain
management and big data analytics
© 2019 TigerGraph. All Rights Reserved
How Can TigerGraph Help You?
Improve Operational EfficiencyReduce Costs & Manage RisksIncrease Revenue
• Recommendation Engine
• Real-time Customer 360/
MDM
• Product & Service Marketing
• Fraud Detection
• Anti-Money Laundering
(AML)
• Risk Assessment & Monitoring
• Cyber Security
• Enterprise Knowledge Graph
• Network, IT and Cloud
Resource Optimization
• Energy Management System
• Supply Chain Analysis
Analyze all interactions
in real-time to sell more
Reduce costs and assess and
monitor risks effectively
Manage resources for
maximum output
Foundational Use Cases: Geospatial Analysis, Time Series Analysis, AI and Machine Learning
© 2019 TigerGraph. All Rights Reserved
Driving Business Outcomes with TigerGraph
Increase Revenue
Grew to Billion+ in annual
revenue in 5 years with
TigerGraph
Reduce Costs &
Manage Risks
Recommendation Engine
Detects fraud in real-time
for 300+ Million calls per
day with TigerGraph
Fraud Detection
Improve Operational
Efficiency
Improve Operational
Efficiency
Optimizes infrastructure to
minimize outages for
critical workloads with
TigerGraph
Network & IT Resource Optimization
© 2019 TigerGraph. All Rights Reserved
Accumulators
7
Example: A teacher collects test papers
from all students and calculates an
average score.
Teacher: node with an accumulator
Student: node
Student-to-teacher: edge
Test paper: message sent to
accumulator
Average Score: final value of
accumulator
Phase 1: teacher collects all the test
papers
Phase 2: teacher grades it and
calculates the average score.
© 2019 TigerGraph. All Rights Reserved
Example 1: Counting Movies Seen by
Friends
Analogy: You ask each of your friends to tally how many movies they
saw last year (They work at the same time → Parallelism!)
● This is the Gathering phase
● Next, you need to
Consolidate into one list.
→ Eliminate the duplicates Lee
Bob
Chris
Sue
If we are only counting (not recording names),
How can we eliminate duplicates?
P
Q
R
S
T
© 2019 TigerGraph. All Rights Reserved
Eliminating Duplication: visited flag
● Traditional method: Each target
Item has a true/false "flag", initialized to "false"
● If a flag is "false":
○ It may be counted;
Set the flag to "true"
● If a flag is "true":
○ Skip it
● ⇒ Each item is counted once
Lee
Bob
Chris
Sue
If we are only counting (not recording names),
How can we eliminate duplicates?
© 2019 TigerGraph. All Rights Reserved
Counting Movies with Accumulators
An accumulator is a runtime, shared variable with a built-in update
function.
1. Each friend's tally is a local Accumulator.
2. The visited flag is also a local Accumulator.
a. Bob, Chris, and Sue all visit "R", but we don't know who will first.
3. GSQL queries are designed to let each friend work in parallel, but
at its own pace, and in any order
4. Consolidate the Lists into one global Accumulator.
Bob: 2 (P, Q) Chris: 1 (S)
Sue: 2 (R,T)
© 2019 TigerGraph. All Rights Reserved
Optimization: One global list/tally
Instead of each friend keeping a separate tally…
Keep only one tally.
● Eliminates the consolidate step
● Saves memory
Each friend still works separately,
but they record their efforts in one common place.
Lee
Bob
Chris
Sue
© 2019 TigerGraph. All Rights Reserved
friendsMovieCount GSQL Query
CREATE QUERY friendsMovieCount (VERTEX me) {
OrAccum @visited = false; // @ means local
SumAccum<INT> @@movieCount; // @@ means global
#~~~~~~~~~~~~~~
Start = {me};
Friends = SELECT f # 1. Identify my friends
FROM Start:s -(friendOf:e)- Person:f;
#~~~~~~~~~~~~~~
Movies = SELECT m # 2. Identify the movies they've seen
FROM Friends:f -(saw:r)- Movie:m
ACCUM
IF m.@visited == false THEN
@@movieCount += 1, m.@visited += true; # 3. Count each movie once
#~~~~~~~~~~~~~~
PRINT @@movieCount;
}
© 2019 TigerGraph. All Rights Reserved
Review - Accumulator Properties
● Scope: Local (per vertex) or global
● Multiple data types and functions available
○ For flag: Boolean true/false data, OR function
○ For tally: Integer data, Sum function
● Supports multi-worker processing for parallelism
○ Shared: Anyone can read
○ Shared: Anyone can update submit an update request
○ All the accumulated updates are processed at once, at the end.
© 2019 TigerGraph. All Rights Reserved
Types of Accumulators
The GSQL language provides many different accumulators, which follow the
same rules for receiving and accessing data. However each of them has their
unique way of aggregating values.
14
Old Value:
2
New Value:
11
1, 3, 5
1
3 5
SumAccum<int>
Old Value:
2
New Value:
5
1, 3, 5
1 3
MaxAccum<int>
Old Value:
2
New Value:
1
1, 3, 5
1 3
MinAccum<int>
Old Value:
2
New Value:
2.75
1, 3, 5
1 3
AvgAccum
5 5 5
Computes and stores the
cumulative sum of numeric
values or the cumulative
concatenation of text values.
Computes and stores the
cumulative maximum of
a series of values.
Computes and stores the
cumulative mean of a
series of numeric values.
Computes and stores the
cumulative minimum of
a series of values.
© 2019 TigerGraph. All Rights Reserved
The GSQL language provides many different accumulators, which follow the
same rules for receiving and accessing data. However each of them has their
unique way of aggregating values.
15
Old Value:
[2]
New Value:
[2,1,3,5]
1, 3, 3, 5
1 3 5
SetAccum<int>
Old Value:
[2]
New Value:
[2,1,5,3,3]
1, 5, 3, 3
1 3
ListAccum<int>
Old Value:
[1->1]
New Value:
1->6
5->2
1->2
1->3
5->2
1->2 1->3
MapAccum<int,SumAccum<int>>
Old Value:
[userD,150]
New Value:
[userC,300,
UserD,150,
userA,100]
userC,300
userA,100
(“userA”, 100)
HeapAccum<Tuple>
5 5->23 3 (“userC”, 300)
Maintains a collection of
unique elements.
Maintains a sequential
collection of elements.
Maintains a collection of
(key → value) pairs.
Maintains a sorted collection of
tuples and enforces a
maximum number of tuples in
the collection
Types of Accumulators, continued
© 2019 TigerGraph. All Rights Reserved
Use Case: Graph Algorithms
PageRank analyzes the WHOLE graph
● For each node V:
PR(V) = sum [ PR(A)
/deg(A)
+ PR(B)
/deg(B)
+ PR(C)
/deg(C)
]
○ Summing contributions from several independent nodes
→ Ideal task for accumulators and parallel processing
● Compute a score for each node → parallelism
● Iterative method: Keep recalculating PR(v) for the full graph,
unless the max change in PR < threshold → MaxAccum
V
A
B
C
© 2018 TigerGraph. All Rights Reserved 17
Input:
A person p, two integer parameters k1
and k2
Algorithm steps:
1. Find all movies p has rated;
2. Find all persons rated same movies as p;
3. Based on the movie ratings, find the k1
persons that have most similar tastes with p;
4. Find all movies these k1
persons rated that p hasn’t rated yet;
5. Recommend the top k2
movies with highest average rating by the k1
persons;
Output:
At most k2
movies to be recommended to person p.
p
…...
rate
rate
rate
PRatedMovies
PSet
…...
PeopleRatedSameMovies
rate
rate
rate
rate
…...
rate
rate
rate
rate
Implementing Movie Recommendation Algorithm
© 2019 TigerGraph. All Rights Reserved
More Use Cases: Anti-Fraud
TestDrive Anti-Fraud: https://testdrive.tigergraph.com/main/dashboard
CIrcle Detection:
● Is money passing from A → B → C → … → back to A?
See Graph Gurus #4 on our YouTube Channel:
https://www.youtube.com/tigergraph
© 2019 TigerGraph. All Rights Reserved
Demo
19
© 2019 TigerGraph. All Rights Reserved
Summary
• Graph Traversal and Graph Analytics can be
complex, but also amenable to parallelism.
• Accumulators, coupled with the TigerGraph MPP
engine, provide simple and efficient parallelized
aggregation.
• Accumulators come in a variety of shapes and sizes,
to fit all different needs.
20
Q&A
Please send your questions via the Q&A menu in Zoom
21
© 2019 TigerGraph. All Rights Reserved
NEW! Graph Gurus Developer Office Hours
22
The Graph Gurus Webinar in late March or catch up on previous
episodes: https://www.tigergraph.com/webinars-and-events/
Every Thursday at 11:00 am Pacific
Talk directly with our engineers every
week. During office hours, you get
answers to any questions pertaining to
graph modeling and GSQL
programming.
https://info.tigergraph.com/officehours
© 2019 TigerGraph. All Rights Reserved
Additional Resources
23
New Developer Portal
https://www.tigergraph.com/developers/
Download the Developer Edition or Enterprise Free Trial
https://www.tigergraph.com/download/
Guru Scripts
https://github.com/tigergraph/ecosys/tree/master/guru_scripts
Join our Developer Forum
https://groups.google.com/a/opengsql.org/forum/#!forum/gsql-users
@TigerGraphDB youtube.com/tigergraph facebook.com/TigerGraphDB linkedin.com/company/TigerGraph

More Related Content

What's hot (20)

PDF
Modern Data Challenges require Modern Graph Technology
Neo4j
 
PDF
Neo4j: The path to success with Graph Database and Graph Data Science
Neo4j
 
PDF
Introduction to Neo4j for the Emirates & Bahrain
Neo4j
 
PDF
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
PDF
Data Modeling with Neo4j
Neo4j
 
PDF
The Path To Success With Graph Database and Analytics
Neo4j
 
PDF
Data Governance Best Practices, Assessments, and Roadmaps
DATAVERSITY
 
PDF
Data platform architecture
Sudheer Kondla
 
PDF
Introduction to Graph Databases.pdf
Neo4j
 
PDF
Getting Started with Databricks SQL Analytics
Databricks
 
PPT
Tableau Architecture
Kishore Chaganti
 
PDF
Introduction SQL Analytics on Lakehouse Architecture
Databricks
 
PDF
Choosing Between Microsoft Fabric, Azure Synapse Analytics and Azure Data Fac...
Cathrine Wilhelmsen
 
PPTX
Volvo Cars - Retrieving Safety Insights using Graphs (GraphSummit Stockholm 2...
Neo4j
 
PPTX
Applying Network Analytics in KYC
Neo4j
 
PDF
Moving to Databricks & Delta
Databricks
 
PDF
Workshop Introduction to Neo4j
Neo4j
 
PDF
Introducing Neo4j
Neo4j
 
PDF
Introduction to Knowledge Graphs and Semantic AI
Semantic Web Company
 
PPTX
The openCypher Project - An Open Graph Query Language
Neo4j
 
Modern Data Challenges require Modern Graph Technology
Neo4j
 
Neo4j: The path to success with Graph Database and Graph Data Science
Neo4j
 
Introduction to Neo4j for the Emirates & Bahrain
Neo4j
 
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Data Modeling with Neo4j
Neo4j
 
The Path To Success With Graph Database and Analytics
Neo4j
 
Data Governance Best Practices, Assessments, and Roadmaps
DATAVERSITY
 
Data platform architecture
Sudheer Kondla
 
Introduction to Graph Databases.pdf
Neo4j
 
Getting Started with Databricks SQL Analytics
Databricks
 
Tableau Architecture
Kishore Chaganti
 
Introduction SQL Analytics on Lakehouse Architecture
Databricks
 
Choosing Between Microsoft Fabric, Azure Synapse Analytics and Azure Data Fac...
Cathrine Wilhelmsen
 
Volvo Cars - Retrieving Safety Insights using Graphs (GraphSummit Stockholm 2...
Neo4j
 
Applying Network Analytics in KYC
Neo4j
 
Moving to Databricks & Delta
Databricks
 
Workshop Introduction to Neo4j
Neo4j
 
Introducing Neo4j
Neo4j
 
Introduction to Knowledge Graphs and Semantic AI
Semantic Web Company
 
The openCypher Project - An Open Graph Query Language
Neo4j
 

Similar to Graph Gurus Episode 11: Accumulators for Complex Graph Analytics (20)

PDF
Graph Gurus 15: Introducing TigerGraph 2.4
TigerGraph
 
PDF
Graph Gurus Episode 7: Connecting the Dots in Real-Time: Deep Link Analysis w...
TigerGraph
 
PDF
DA 592 - Term Project Report - Berker Kozan Can Koklu
Can Köklü
 
PDF
Graph Gurus Episode 32: Using Graph Algorithms for Advanced Analytics Part 5
TigerGraph
 
PDF
Using Graph Algorithms for Advanced Analytics - Part 5 Classification
TigerGraph
 
PPTX
Learning to Rank: From Theory to Production - Malvina Josephidou & Diego Cecc...
Lucidworks
 
PDF
Flink Forward San Francisco 2018: Gregory Fee - "Bootstrapping State In Apach...
Flink Forward
 
PDF
Planning and Tracking Agile Projects
Mike Cohn
 
PPTX
Introduction to GluonNLP
Apache MXNet
 
PDF
Graph Gurus 21: Integrating Real-Time Deep-Link Graph Analytics with Spark AI
TigerGraph
 
PDF
Graph Gurus Episode 19: Deep Learning Implemented by GSQL on a Native Paralle...
TigerGraph
 
PDF
Graph Gurus Episode 3: Anti Fraud and AML Part 1
TigerGraph
 
PDF
Python tutorial for ML
Bin Han
 
PDF
Graph Gurus Episode 26: Using Graph Algorithms for Advanced Analytics Part 1
TigerGraph
 
PDF
Deep learning for product title summarization
MLconf
 
PPTX
Bootstrapping state in Apache Flink
DataWorks Summit
 
PDF
Machine learning for predictive maintenance external
Prashant K Dhingra
 
PPTX
No liftoff, touchdown, or heartbeat shall miss because of a software failure
Rogue Wave Software
 
PPTX
Node.js Deeper Dive
Justin Reock
 
PDF
Using Graph Algorithms For Advanced Analytics - Part 4 Similarity 30 graph al...
TigerGraph
 
Graph Gurus 15: Introducing TigerGraph 2.4
TigerGraph
 
Graph Gurus Episode 7: Connecting the Dots in Real-Time: Deep Link Analysis w...
TigerGraph
 
DA 592 - Term Project Report - Berker Kozan Can Koklu
Can Köklü
 
Graph Gurus Episode 32: Using Graph Algorithms for Advanced Analytics Part 5
TigerGraph
 
Using Graph Algorithms for Advanced Analytics - Part 5 Classification
TigerGraph
 
Learning to Rank: From Theory to Production - Malvina Josephidou & Diego Cecc...
Lucidworks
 
Flink Forward San Francisco 2018: Gregory Fee - "Bootstrapping State In Apach...
Flink Forward
 
Planning and Tracking Agile Projects
Mike Cohn
 
Introduction to GluonNLP
Apache MXNet
 
Graph Gurus 21: Integrating Real-Time Deep-Link Graph Analytics with Spark AI
TigerGraph
 
Graph Gurus Episode 19: Deep Learning Implemented by GSQL on a Native Paralle...
TigerGraph
 
Graph Gurus Episode 3: Anti Fraud and AML Part 1
TigerGraph
 
Python tutorial for ML
Bin Han
 
Graph Gurus Episode 26: Using Graph Algorithms for Advanced Analytics Part 1
TigerGraph
 
Deep learning for product title summarization
MLconf
 
Bootstrapping state in Apache Flink
DataWorks Summit
 
Machine learning for predictive maintenance external
Prashant K Dhingra
 
No liftoff, touchdown, or heartbeat shall miss because of a software failure
Rogue Wave Software
 
Node.js Deeper Dive
Justin Reock
 
Using Graph Algorithms For Advanced Analytics - Part 4 Similarity 30 graph al...
TigerGraph
 
Ad

More from TigerGraph (20)

PDF
MAXIMIZING THE VALUE OF SCIENTIFIC INFORMATION TO ACCELERATE INNOVATION
TigerGraph
 
PDF
Better Together: How Graph database enables easy data integration with Spark ...
TigerGraph
 
PDF
Building an accurate understanding of consumers based on real-world signals
TigerGraph
 
PDF
Care Intervention Assistant - Omaha Clinical Data Information System
TigerGraph
 
PDF
Correspondent Banking Networks
TigerGraph
 
PDF
Delivering Large Scale Real-time Graph Analytics with Dell Infrastructure and...
TigerGraph
 
PDF
Deploying an End-to-End TigerGraph Enterprise Architecture using Kafka, Maria...
TigerGraph
 
PDF
Fraud Detection and Compliance with Graph Learning
TigerGraph
 
PDF
Fraudulent credit card cash-out detection On Graphs
TigerGraph
 
PDF
FROM DATAFRAMES TO GRAPH Data Science with pyTigerGraph
TigerGraph
 
PDF
Customer Experience Management
TigerGraph
 
PDF
Graph+AI for Fin. Services
TigerGraph
 
PDF
Davraz - A graph visualization and exploration software.
TigerGraph
 
PDF
Plume - A Code Property Graph Extraction and Analysis Library
TigerGraph
 
PDF
TigerGraph.js
TigerGraph
 
PDF
GRAPHS FOR THE FUTURE ENERGY SYSTEMS
TigerGraph
 
PDF
Hardware Accelerated Machine Learning Solution for Detecting Fraud and Money ...
TigerGraph
 
PDF
How to Build An AI Based Customer Data Platform: Learn the design patterns fo...
TigerGraph
 
PDF
Machine Learning Feature Design with TigerGraph 3.0 No-Code GUI
TigerGraph
 
PDF
Recommendation Engine with In-Database Machine Learning
TigerGraph
 
MAXIMIZING THE VALUE OF SCIENTIFIC INFORMATION TO ACCELERATE INNOVATION
TigerGraph
 
Better Together: How Graph database enables easy data integration with Spark ...
TigerGraph
 
Building an accurate understanding of consumers based on real-world signals
TigerGraph
 
Care Intervention Assistant - Omaha Clinical Data Information System
TigerGraph
 
Correspondent Banking Networks
TigerGraph
 
Delivering Large Scale Real-time Graph Analytics with Dell Infrastructure and...
TigerGraph
 
Deploying an End-to-End TigerGraph Enterprise Architecture using Kafka, Maria...
TigerGraph
 
Fraud Detection and Compliance with Graph Learning
TigerGraph
 
Fraudulent credit card cash-out detection On Graphs
TigerGraph
 
FROM DATAFRAMES TO GRAPH Data Science with pyTigerGraph
TigerGraph
 
Customer Experience Management
TigerGraph
 
Graph+AI for Fin. Services
TigerGraph
 
Davraz - A graph visualization and exploration software.
TigerGraph
 
Plume - A Code Property Graph Extraction and Analysis Library
TigerGraph
 
TigerGraph.js
TigerGraph
 
GRAPHS FOR THE FUTURE ENERGY SYSTEMS
TigerGraph
 
Hardware Accelerated Machine Learning Solution for Detecting Fraud and Money ...
TigerGraph
 
How to Build An AI Based Customer Data Platform: Learn the design patterns fo...
TigerGraph
 
Machine Learning Feature Design with TigerGraph 3.0 No-Code GUI
TigerGraph
 
Recommendation Engine with In-Database Machine Learning
TigerGraph
 
Ad

Recently uploaded (20)

PDF
How to Hire AI Developers_ Step-by-Step Guide in 2025.pdf
DianApps Technologies
 
PDF
HiHelloHR – Simplify HR Operations for Modern Workplaces
HiHelloHR
 
PDF
Wondershare PDFelement Pro Crack for MacOS New Version Latest 2025
bashirkhan333g
 
PDF
유니티에서 Burst Compiler+ThreadedJobs+SIMD 적용사례
Seongdae Kim
 
PDF
vMix Pro 28.0.0.42 Download vMix Registration key Bundle
kulindacore
 
PDF
SAP Firmaya İade ABAB Kodları - ABAB ile yazılmıl hazır kod örneği
Salih Küçük
 
PDF
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
 
PPTX
Milwaukee Marketo User Group - Summer Road Trip: Mapping and Personalizing Yo...
bbedford2
 
PDF
Unlock Efficiency with Insurance Policy Administration Systems
Insurance Tech Services
 
PDF
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
PDF
4K Video Downloader Plus Pro Crack for MacOS New Download 2025
bashirkhan333g
 
PDF
Generic or Specific? Making sensible software design decisions
Bert Jan Schrijver
 
PPTX
Finding Your License Details in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PDF
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
PPTX
ChiSquare Procedure in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PPTX
Help for Correlations in IBM SPSS Statistics.pptx
Version 1 Analytics
 
PPTX
Empowering Asian Contributions: The Rise of Regional User Groups in Open Sour...
Shane Coughlan
 
PDF
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
PDF
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
PDF
Empower Your Tech Vision- Why Businesses Prefer to Hire Remote Developers fro...
logixshapers59
 
How to Hire AI Developers_ Step-by-Step Guide in 2025.pdf
DianApps Technologies
 
HiHelloHR – Simplify HR Operations for Modern Workplaces
HiHelloHR
 
Wondershare PDFelement Pro Crack for MacOS New Version Latest 2025
bashirkhan333g
 
유니티에서 Burst Compiler+ThreadedJobs+SIMD 적용사례
Seongdae Kim
 
vMix Pro 28.0.0.42 Download vMix Registration key Bundle
kulindacore
 
SAP Firmaya İade ABAB Kodları - ABAB ile yazılmıl hazır kod örneği
Salih Küçük
 
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
 
Milwaukee Marketo User Group - Summer Road Trip: Mapping and Personalizing Yo...
bbedford2
 
Unlock Efficiency with Insurance Policy Administration Systems
Insurance Tech Services
 
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
4K Video Downloader Plus Pro Crack for MacOS New Download 2025
bashirkhan333g
 
Generic or Specific? Making sensible software design decisions
Bert Jan Schrijver
 
Finding Your License Details in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
ChiSquare Procedure in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Help for Correlations in IBM SPSS Statistics.pptx
Version 1 Analytics
 
Empowering Asian Contributions: The Rise of Regional User Groups in Open Sour...
Shane Coughlan
 
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
Empower Your Tech Vision- Why Businesses Prefer to Hire Remote Developers fro...
logixshapers59
 

Graph Gurus Episode 11: Accumulators for Complex Graph Analytics

  • 1. Graph Gurus Episode 11 Using Accumulators in GSQL for Complex Graph Analytics
  • 2. © 2019 TigerGraph. All Rights Reserved Welcome ● Attendees are muted ● If you have any Zoom issues please contact the panelists via chat ● We will have 10 min for Q&A at the end so please send your questions at any time using the Q&A tab in the Zoom menu ● The webinar will be recorded and sent via email 2
  • 3. © 2019 TigerGraph. All Rights Reserved Developer Edition Available We now offer Docker versions and VirtualBox versions of the TigerGraph Developer Edition, so you can now run on ● MacOS ● Windows 10 ● Linux Developer Edition Download https://www.tigergraph.com/developer/ 3 Version 2.3 Released Today
  • 4. © 2019 TigerGraph. All Rights Reserved Today's Gurus 4 Victor Lee Director of Product Management ● BS in Electrical Engineering and Computer Science from UC Berkeley, MS in Electrical Engineering from Stanford University ● PhD in Computer Science from Kent State University focused on graph data mining ● 15+ years in tech industry Gaurav Deshpande Vice President of Marketing ● Built out and positioned IBM’s Big Data and Analytics portfolio, driving 45 percent year-over-year growth. ● Led 2 startups through explosive growth - i2 Technologies (IPO) & Trigo Technologies (largest MDM acquisition by IBM) ● Big Data Analytics Veteran, 14 patents in supply chain management and big data analytics
  • 5. © 2019 TigerGraph. All Rights Reserved How Can TigerGraph Help You? Improve Operational EfficiencyReduce Costs & Manage RisksIncrease Revenue • Recommendation Engine • Real-time Customer 360/ MDM • Product & Service Marketing • Fraud Detection • Anti-Money Laundering (AML) • Risk Assessment & Monitoring • Cyber Security • Enterprise Knowledge Graph • Network, IT and Cloud Resource Optimization • Energy Management System • Supply Chain Analysis Analyze all interactions in real-time to sell more Reduce costs and assess and monitor risks effectively Manage resources for maximum output Foundational Use Cases: Geospatial Analysis, Time Series Analysis, AI and Machine Learning
  • 6. © 2019 TigerGraph. All Rights Reserved Driving Business Outcomes with TigerGraph Increase Revenue Grew to Billion+ in annual revenue in 5 years with TigerGraph Reduce Costs & Manage Risks Recommendation Engine Detects fraud in real-time for 300+ Million calls per day with TigerGraph Fraud Detection Improve Operational Efficiency Improve Operational Efficiency Optimizes infrastructure to minimize outages for critical workloads with TigerGraph Network & IT Resource Optimization
  • 7. © 2019 TigerGraph. All Rights Reserved Accumulators 7 Example: A teacher collects test papers from all students and calculates an average score. Teacher: node with an accumulator Student: node Student-to-teacher: edge Test paper: message sent to accumulator Average Score: final value of accumulator Phase 1: teacher collects all the test papers Phase 2: teacher grades it and calculates the average score.
  • 8. © 2019 TigerGraph. All Rights Reserved Example 1: Counting Movies Seen by Friends Analogy: You ask each of your friends to tally how many movies they saw last year (They work at the same time → Parallelism!) ● This is the Gathering phase ● Next, you need to Consolidate into one list. → Eliminate the duplicates Lee Bob Chris Sue If we are only counting (not recording names), How can we eliminate duplicates? P Q R S T
  • 9. © 2019 TigerGraph. All Rights Reserved Eliminating Duplication: visited flag ● Traditional method: Each target Item has a true/false "flag", initialized to "false" ● If a flag is "false": ○ It may be counted; Set the flag to "true" ● If a flag is "true": ○ Skip it ● ⇒ Each item is counted once Lee Bob Chris Sue If we are only counting (not recording names), How can we eliminate duplicates?
  • 10. © 2019 TigerGraph. All Rights Reserved Counting Movies with Accumulators An accumulator is a runtime, shared variable with a built-in update function. 1. Each friend's tally is a local Accumulator. 2. The visited flag is also a local Accumulator. a. Bob, Chris, and Sue all visit "R", but we don't know who will first. 3. GSQL queries are designed to let each friend work in parallel, but at its own pace, and in any order 4. Consolidate the Lists into one global Accumulator. Bob: 2 (P, Q) Chris: 1 (S) Sue: 2 (R,T)
  • 11. © 2019 TigerGraph. All Rights Reserved Optimization: One global list/tally Instead of each friend keeping a separate tally… Keep only one tally. ● Eliminates the consolidate step ● Saves memory Each friend still works separately, but they record their efforts in one common place. Lee Bob Chris Sue
  • 12. © 2019 TigerGraph. All Rights Reserved friendsMovieCount GSQL Query CREATE QUERY friendsMovieCount (VERTEX me) { OrAccum @visited = false; // @ means local SumAccum<INT> @@movieCount; // @@ means global #~~~~~~~~~~~~~~ Start = {me}; Friends = SELECT f # 1. Identify my friends FROM Start:s -(friendOf:e)- Person:f; #~~~~~~~~~~~~~~ Movies = SELECT m # 2. Identify the movies they've seen FROM Friends:f -(saw:r)- Movie:m ACCUM IF m.@visited == false THEN @@movieCount += 1, m.@visited += true; # 3. Count each movie once #~~~~~~~~~~~~~~ PRINT @@movieCount; }
  • 13. © 2019 TigerGraph. All Rights Reserved Review - Accumulator Properties ● Scope: Local (per vertex) or global ● Multiple data types and functions available ○ For flag: Boolean true/false data, OR function ○ For tally: Integer data, Sum function ● Supports multi-worker processing for parallelism ○ Shared: Anyone can read ○ Shared: Anyone can update submit an update request ○ All the accumulated updates are processed at once, at the end.
  • 14. © 2019 TigerGraph. All Rights Reserved Types of Accumulators The GSQL language provides many different accumulators, which follow the same rules for receiving and accessing data. However each of them has their unique way of aggregating values. 14 Old Value: 2 New Value: 11 1, 3, 5 1 3 5 SumAccum<int> Old Value: 2 New Value: 5 1, 3, 5 1 3 MaxAccum<int> Old Value: 2 New Value: 1 1, 3, 5 1 3 MinAccum<int> Old Value: 2 New Value: 2.75 1, 3, 5 1 3 AvgAccum 5 5 5 Computes and stores the cumulative sum of numeric values or the cumulative concatenation of text values. Computes and stores the cumulative maximum of a series of values. Computes and stores the cumulative mean of a series of numeric values. Computes and stores the cumulative minimum of a series of values.
  • 15. © 2019 TigerGraph. All Rights Reserved The GSQL language provides many different accumulators, which follow the same rules for receiving and accessing data. However each of them has their unique way of aggregating values. 15 Old Value: [2] New Value: [2,1,3,5] 1, 3, 3, 5 1 3 5 SetAccum<int> Old Value: [2] New Value: [2,1,5,3,3] 1, 5, 3, 3 1 3 ListAccum<int> Old Value: [1->1] New Value: 1->6 5->2 1->2 1->3 5->2 1->2 1->3 MapAccum<int,SumAccum<int>> Old Value: [userD,150] New Value: [userC,300, UserD,150, userA,100] userC,300 userA,100 (“userA”, 100) HeapAccum<Tuple> 5 5->23 3 (“userC”, 300) Maintains a collection of unique elements. Maintains a sequential collection of elements. Maintains a collection of (key → value) pairs. Maintains a sorted collection of tuples and enforces a maximum number of tuples in the collection Types of Accumulators, continued
  • 16. © 2019 TigerGraph. All Rights Reserved Use Case: Graph Algorithms PageRank analyzes the WHOLE graph ● For each node V: PR(V) = sum [ PR(A) /deg(A) + PR(B) /deg(B) + PR(C) /deg(C) ] ○ Summing contributions from several independent nodes → Ideal task for accumulators and parallel processing ● Compute a score for each node → parallelism ● Iterative method: Keep recalculating PR(v) for the full graph, unless the max change in PR < threshold → MaxAccum V A B C
  • 17. © 2018 TigerGraph. All Rights Reserved 17 Input: A person p, two integer parameters k1 and k2 Algorithm steps: 1. Find all movies p has rated; 2. Find all persons rated same movies as p; 3. Based on the movie ratings, find the k1 persons that have most similar tastes with p; 4. Find all movies these k1 persons rated that p hasn’t rated yet; 5. Recommend the top k2 movies with highest average rating by the k1 persons; Output: At most k2 movies to be recommended to person p. p …... rate rate rate PRatedMovies PSet …... PeopleRatedSameMovies rate rate rate rate …... rate rate rate rate Implementing Movie Recommendation Algorithm
  • 18. © 2019 TigerGraph. All Rights Reserved More Use Cases: Anti-Fraud TestDrive Anti-Fraud: https://testdrive.tigergraph.com/main/dashboard CIrcle Detection: ● Is money passing from A → B → C → … → back to A? See Graph Gurus #4 on our YouTube Channel: https://www.youtube.com/tigergraph
  • 19. © 2019 TigerGraph. All Rights Reserved Demo 19
  • 20. © 2019 TigerGraph. All Rights Reserved Summary • Graph Traversal and Graph Analytics can be complex, but also amenable to parallelism. • Accumulators, coupled with the TigerGraph MPP engine, provide simple and efficient parallelized aggregation. • Accumulators come in a variety of shapes and sizes, to fit all different needs. 20
  • 21. Q&A Please send your questions via the Q&A menu in Zoom 21
  • 22. © 2019 TigerGraph. All Rights Reserved NEW! Graph Gurus Developer Office Hours 22 The Graph Gurus Webinar in late March or catch up on previous episodes: https://www.tigergraph.com/webinars-and-events/ Every Thursday at 11:00 am Pacific Talk directly with our engineers every week. During office hours, you get answers to any questions pertaining to graph modeling and GSQL programming. https://info.tigergraph.com/officehours
  • 23. © 2019 TigerGraph. All Rights Reserved Additional Resources 23 New Developer Portal https://www.tigergraph.com/developers/ Download the Developer Edition or Enterprise Free Trial https://www.tigergraph.com/download/ Guru Scripts https://github.com/tigergraph/ecosys/tree/master/guru_scripts Join our Developer Forum https://groups.google.com/a/opengsql.org/forum/#!forum/gsql-users @TigerGraphDB youtube.com/tigergraph facebook.com/TigerGraphDB linkedin.com/company/TigerGraph