Temporal graph motifs and how to find them
or how I inadvertently got into big data engineering 😳
Naomi Arnold
NetPLACE
1
Wednesday, 12 April 2023
A temporal network
NetPLACE
2
Wednesday, 12 April 2023
id:NaomiArnold
Postdoc
t2021-t2023
id:ATI
Postdoc
t2021-t2023
id:Raphtory
Developer
t2020-
PhD CS
t2017-t2021
id:QMUL
id:FETA
Lead developer
t2017-
id:Pometry
Enterprise spinout
T2021-
Adviser
t2021-
BA Maths
t2014-t2017
Postdoc
T2023+
id:NULondon
Introducing Raphtory
Raphtory overview�The first platform built especially for large temporal networks
Distributed graph with full history stored
User endpoint for querying the graph
Attach data from anywhere
Converted to
updates
Shortest Path
PageRank
Cycle Detection
Cascade Spreading
Similarity
Degree Centrality
Triadic Motifs
Temporal LPA
30+ algorithms out of the box
With ability to extend or write your own in minutes
Raphtory x Temporal Motif analysis in Crypto
Temporal Motifs in dark market trades�The case of the Alphabay market
NetPLACE
7
Wednesday, 12 April 2023
Wallet
Wallet
Sends money to
What do we mean by temporal motif?
NetPLACE
8
Wednesday, 12 April 2023
Introducing a δ-temporal motif
7
13
9
12
5
21
9
7
13
l
NetPLACE
9
Wednesday, 12 April 2023
Pairwise trading between users.
Fanning out of money. User making batch purchases? Mixer splitting a transaction?
Funnelling of money. Vendor receiving purchase orders? Recipient of a split transaction?
What motifs are we looking for?
And what might they tell us ?
NetPLACE
10
Wednesday, 12 April 2023
Dataset and Experiment
~ 11 million nodes (users)
~ 33.6 million transactions
Dataset of all users who have transacted with Alphabay and their transactions
Local motif counting algorithm implemented in Raphtory, took 2hrs in total to build the graph and run the algorithm
Motifs in Alphabay
NetPLACE
11
Wednesday, 12 April 2023
Fanout motif (all outgoing) the most prevalent by orders of magnitude
Followed by single-direction pairwise motif
Followed largely by funneling (all incoming) motifs
Motifs local to the node
NetPLACE
12
Wednesday, 12 April 2023
What is the spread of motifs that nodes participate in?
Motifs of heavy hitting nodes
NetPLACE
13
Wednesday, 12 April 2023
Top two nodes with the highest number of motifs
Alphabay market node (not even in the top 10!!!)
All outgoing. Mixer service? Crypto on-ramp?
All incoming. Crypto exchange? Big seller?
Conveyance-style motif. Consistent with being an escrow service
NetPLACE
14
Wednesday, 12 April 2023
Total motif counts of different types
Composition of different motifs
The sharp downturn in motifs is long before Alphabay is shut down
Change from peer-to-peer motifs to star motifs which doesn’t return after Alphabay shut down
Motifs in Alphabay over time
Future directions�Motif-based clustering of wallets
Turns out nodes can be clustered very well based on their motif participation!
Are there salient groups of nodes which have similar types of motifs (possibly playing a similar role in the system)
Why can working with large networks be so damn difficult?
Power laws everywhere
NetPLACE
17
Wednesday, 12 April 2023
The power laws/heavy tails of complex systems that make them so fascinating can take many algorithms into a worst case scenario and makes problems hard to distribute
Memory constraints and long runtimes
NetPLACE
18
Wednesday, 12 April 2023
Large networks are a challenge to represent in-memory especially when they are temporal. End up spending £££ on big AWS/Azure boxes
YAY! It took 24 hours but I finally got my results out
That’s brilliant news! What does it look like with delta = 1 day instead of 1 hour? What about if you remove the top 10 nodes? I’m really curious to see about…
Code that takes a long time to run inhibits your enthusiasm for experimentation with different parameters/setups
What did I learn from the process to pass on?
Get a crash course on data structures�Example: Arrays vs Lists
NetPLACE
20
Wednesday, 12 April 2023
Source: https://www.bigocheatsheet.com/
What data structure out of lists, sets, arrays, vectors makes sense?
Learn how to use and interpret a code profiler
Memory profiler – monitors the objects being held in-memory and their sizes. Can be useful for spotting memory leaks (variables not being cleared up when they are done with) or heavy objects.
CPU profiler – shows how long (in a sense) the program is spending in different routines. If the program is spending > 80% of time in one routine, it’s almost certainly something you can optimize.
NetPLACE
21
Wednesday, 12 April 2023
Find a programming buddy who can help you
NetPLACE
22
Wednesday, 12 April 2023
“Rubber ducking” process – even the act of explaining how your procedure works might help you realise why it’s slow or not scaling well
End up with bonus hacky skills that you wouldn’t have even thought to look for
The longer you have programmed for, the more eagle-eyed you become for spotting potentially inefficient routines or data structures
What it feels like pair programming with someone more experienced than you
NetPLACE
23
Wednesday, 12 April 2023
Bigger picture outcomes for Raphtory
Raphtory improvements as a result
NetPLACE
25
Wednesday, 12 April 2023
Thank you for listening!
Questions/thoughts?
narnolddd
narnolddd
naomi.arnold@nulondon.ac.uk
Thanks to Richard Clegg, Peijie Zhong, Raul Mondragon (QMUL), Felix Cuadrado (UPM), Ben Steer and Fabian Murariu (Pometry)
Github.com/Raphtory
pip install raphtory