Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Problem-Solving using Graph Traversals
      Searching, Scoring, Ranking, and Recommendation


                  Marko A. ...
Abstract
A graph is a data structure that links a set of vertices by a set of edges.
Modern graph databases support multi-...
Outline

• Graph Structures, Algorithms, and Algebras

• Graph Databases and the Property Graph

• TinkerPop Open-Source G...
difficulty
    graphs




    algebra
 databases


    indices
               time


data models
                          ...
Outline

• Graph Structures, Algorithms, and Algebras

• Graph Databases and the Property Graph

• TinkerPop Open-Source G...
difficulty
    graphs




    algebra
 databases


    indices
               time


data models
                          ...
G = (V, E)
A Vertex




There once was a vertex i ∈ V named tenderlove.
Two Vertices




And then came along another vertex j ∈ V named sixwing.
Thus, i, j ∈ V .
A Directed Edge




Our tenderlove extended a relationship to sixwing. Thus,
(i, j) ∈ E.
The Single-Relational, Directed Graph




More vertices join, create edges and, in turn, the graph grows...
The Single-Relational, Directed Graph as a Matrix

A single-relational graph defined as

                         G = (V, E...
The Single-Relational, Directed Graph as a Matrix



                                0    1       1   0

                 ...
The Single-Relational, Directed Graph

• All vertices are homogenous in meaning—all vertices denote the same
  type of obj...
Applications of Single-Relational Graphs

• Social: define how people interact (collaborators, friends, kins).

• Biologica...
The Limitations of Single-Relational Graph Modeling




       Friendship Graph        Favorite Graph       Works-For Grap...
Numerous Algorithms for Single-Relational Graphs
We would like a more flexible graph modeling construct, but unfortunately,...
G = (V, E)
A Directed Edge
A Directed, Labeled Edge




                             friend




Lets specify the type of relationship that exists bet...
Growing a Multi-Relational Graph




                           friend


                           friend


Lets make the...
Growing a Multi-Relational Graph




             friend   friend




                               friend


            ...
Growing a Multi-Relational Graph




              friend   friend   favorite




                                 friend
...
The Multi-Relational, Directed Graph

• At this point, there is a multi-relational, directed graph: G = (V, E),
  where E ...
The Multi-Relational, Directed Graph as a Tensor

A three-way tensor can be used to represent a multi-relational graph. If...
The Multi-Relational, Directed Graph as a Tensor



          friend
                                                   0 ...
Multi-Relational Graph Algorithms




“Can we evaluate single-relational graph analysis algorithms
on a multi-relational g...
The Meaning of Edge Meanings

               loves loves loves            hates hates hates
           loves              ...
What Do You Mean By “Central?”
                                         answer

                                          ...
Primary Eigenvector


“What does the primary eigenvector of a multi-relational
graph mean?”91011




   9
     We will use...
Primary Eigenvector: Ignoring Edge Labels

                              |V |×|V |
• If π = Bπ, where B ∈ N+            is...
Primary Eigenvector: Isolating Subgraphs
• Are there other primary eigenvectors in the multi-relational graph?

• You can ...
Ultimately what we want is...
Primary Eigenvector: Turing Completeness
• What about using paths through the graph—not simply explicit one-step
  edges?
...
A Path Algebra for Evaluating
Single-Relational Algorithms on Multi-Relational Graphs
• There exists a multi-relational gr...
The Operations of the Multi-Relational Path Algebra

• A · B: ordinary matrix multiplication determines the number of (A, ...
Primary Eigenvectors in a Multi-Relational Graph
• Friend: Afriend π
                                                     ...
Deriving “Semantically Rich” Adjacency Matrices

                                                     0      0         0  ...
Benefits, Drawbacks, and Future of the Path Algebra
• Benefit: Provides a set of theorems for deriving equivalences and thus...
Outline

• Graph Structures, Algorithms, and Algebras

• Graph Databases and the Property Graph

• TinkerPop Open-Source G...
difficulty
    graphs




    algebra
 databases


    indices
               time


data models
                          ...
The Simplicity of a Graph

• A graph is a simple data structure.

• A graph states that something is related to something ...
Representing a Graph in a Relational Database

outV | inV
------------                           A
  A   |   B
  A   |   C...
Representing a Graph in a JSON Database

{
    A : {
      outE   : [B, C]                     A
    }
    B : {
      out...
Representing a Graph in an XML Database

graphml
  graph
    node id=A /                        A
    node id=B /
    node...
Defining a Graph Database



“If any database can represent a graph, then what
              is a graph database?”
Defining a Graph Database



   A graph database is any storage system that
        provides index-free adjacency.2324



 ...
Defining a Graph Database by Example

            Toy Graph                Gremlin
                                     (st...
Graph Databases and Index-Free Adjacency
                                     B                    E



                  ...
Graph Databases and Index-Free Adjacency


                   B                E



        A


                   C      ...
Graph Databases and Index-Free Adjacency


                   B                E



       A


                   C       ...
Non-Graph Databases and Index-Based Adjacency



                                        B    E



      A        B   C   ...
Non-Graph Databases and Index-Based Adjacency


                                                       B                 E...
Non-Graph Databases and Index-Based Adjacency


                                         B                  E



A        ...
Non-Graph Databases and Index-Based Adjacency



                                         B                  E



A       ...
Index-Free Adjacency
• While any database can implicitly represent a graph, only a
  graph database makes the graph struct...
Graph Databases Do Make Use of Indices



                     A            B     C
                                      ...
The Patterns of Relational and Graph Databases
• In a relational database, operations are conceptualized set-theoretically...
Property Graphs and Graph Databases

• Most graph databases support a graph data model known as a property
  graph.

• A p...
From a Multi-Relational Graph...




friend   friend   favorite




                  friend


                   friend
...to a Property Graph
            name=marko
         location=Santa Fe                               lat=11111
         ...
Why the Property Graph Model?
• Standard single-relational graphs do not provide enough modeling flexibility for use in
  r...
Graph Type Morphisms
                                    weighted graph


                                    add weight a...
Outline

• Graph Structures, Algorithms, and Algebras

• Graph Databases and the Property Graph

• TinkerPop Open-Source G...
difficulty
    graphs




    algebra
 databases


    indices
               time


data models
                          ...
TinkerPop: Making Stuff for the Fun of It
• Open source software group started in 2008 focusing on graph data
  structures,...
TinkerPop Productions

• Blueprints: Data Models and their Implementations
  [http://blueprints.tinkerpop.com]
• Pipes: A ...
Blueprints: Data Models and their Implementations

                                    Blueprints

• Blueprints is the lik...
Pipes: A Data Flow Framework using Process Graphs


                                   Pipes

• A dataflow framework with s...
Gremlin: A Graph-Based Programming Language


                             Gremlin    G = (V, E)



• A Turing-complete, g...
Rexster: A RESTful Graph Shell

                                reXster
• Allows Blueprints graphs to be exposed through a...
Typical TinkerPop Graph Stack
       GET http://{host}/{resource}




       Neo4j    NativeStore   TinkerGraph
Outline

• Graph Structures, Algorithms, and Algebras

• Graph Databases and the Property Graph

• TinkerPop Open-Source G...
difficulty
    graphs




    algebra
 databases


    indices
               time


data models
                          ...
Using Graphs in Real-Time Systems
• Most popular graph algorithms require global graph analysis.
        Such algorithms c...
Applications of Graph Databases and Traversal Engines:
            Searching, Scoring, and Ranking
                       ...
Applications of Graph Databases and Traversal Engines:
                   Recommendation
• Recommendation: searching, scor...
There Is More Than “People Who Like X Also Like Y .”
• A system need not be limited to one type of recommendation. With gr...
Real-Time, Domain-Specific, Graph-Based,
                  Problem-Solving Engine



                                      ...
Applicable in Various, Seemingly Diverse Areas
 • Applications to a techno-social government (i.e. collective decision mak...
Toy Graph Dataset
                                                                                      lat=11111
        ...
Dataset Schema in Neo4j
Neo4j [http://neo4j.org] is a “schema-less” database. However, ultimately, data is
represented acc...
Dataset Schema in MySQL
CREATE TABLE friend (
   outV INT NOT NULL,
   inV INT NOT NULL);
CREATE INDEX friend_outV_index U...
Experiment Discussion
• First, for each experiment, no cache is used. For each query (or run of
  queries), caches are res...
Loading Identical Data into MySQL and Neo4j
For the first half of the examples, we will use a small data set. Later we
will...
Basic Gremlin

gremlin   (1 + 2) * 4 div 5
==2.4
gremlin marko +  a.  + rodriguez
==marko a. rodriguez
gremlin func ex:add...
Searching Example: Friends

                                                                          gremlin $_g := neo4j...
Searching Friends
                     SQL/MySQL vs. Gremlin/Neo4j

What are the names of Rand Fitzpatrick’s friends?45
my...
Searching Example: FOAF (No Friends, No Self)

                                                                          g...
Searching FOAF (Not Self)
                     SQL/MySQL vs. Gremlin/Neo4j
What are the names of Rand Fitzpatrick’s friend...
Searching Example: Friend’s Favorites

                                                                          gremlin ....
Searching FOAF (No Self) Favorites
                   SQL/MySQL vs. Gremlin/Neo4j
What do Rand’s friends friends (who are ...
A Traversal Detour Through the Web of Data
                                                                               ...
Defining the Web of Data

• The Web of Data is similar to the Web of Documents (of common knowledge), but
  instead of refe...
Some of the Datasets on the Web of Data
data set           domain       data set           domain       data set          ...
Web of Data Dataset Dependencies
                               homologenekegg                    projectgutenberg
       ...
Web of Data Transforms Development Paradigm
A new application development paradigm emerges. No longer do data and applicat...
Extending our Knowledge of Bryce Canyon National Park
gremlin $h := lds:open()
gremlin $_ := g:add-v($h, ‘http://dbpedia.o...
Augmenting Traversals with the Web of Data
Lets extend our query over the Web of Data. Perhaps incorporate that into our s...
Using the Web of Data for Music Recommendation

Yet another aside: Using only the Web of Data data to recommend musicians/...
Another View of the TinkerPop Stack

                       GET http://{host}/{resource}




  Local Dataset              ...
Scoring Example: How Many of My Friends Favorite X?

                                                                     ...
Non-Graph Databases and Index-Based Adjacency
Non-Graph Databases and Index-Based Adjacency
Non-Graph Databases and Index-Based Adjacency
Non-Graph Databases and Index-Based Adjacency
Non-Graph Databases and Index-Based Adjacency
Non-Graph Databases and Index-Based Adjacency
Non-Graph Databases and Index-Based Adjacency
Non-Graph Databases and Index-Based Adjacency
Non-Graph Databases and Index-Based Adjacency
Non-Graph Databases and Index-Based Adjacency
Non-Graph Databases and Index-Based Adjacency
Non-Graph Databases and Index-Based Adjacency
Non-Graph Databases and Index-Based Adjacency
Non-Graph Databases and Index-Based Adjacency
Non-Graph Databases and Index-Based Adjacency
Non-Graph Databases and Index-Based Adjacency
Non-Graph Databases and Index-Based Adjacency
Non-Graph Databases and Index-Based Adjacency
Non-Graph Databases and Index-Based Adjacency
Non-Graph Databases and Index-Based Adjacency
Non-Graph Databases and Index-Based Adjacency
Non-Graph Databases and Index-Based Adjacency
Non-Graph Databases and Index-Based Adjacency
Non-Graph Databases and Index-Based Adjacency
Non-Graph Databases and Index-Based Adjacency
Upcoming SlideShare
Loading in …5
×

Published on

Non-Graph Databases and Index-Based Adjacency


B E



A B C A
B,C E D,E

D E C D




The Index (explicit) The Graph (implicit)

Published in: Technology
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (Unlimited) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... Download Full EPUB Ebook here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... ACCESS WEBSITE for All Ebooks ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... Download EPUB Ebook here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... Download doc Ebook here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Justin Sinclair has helped thousands of menget their Ex girlfriends back using his methods. Learn them at here♣♣♣ http://t.cn/R50e5nn
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • How will you feel when your Ex girlfriend is in bed with another man? Don't let this happen. Get her back with... ◆◆◆ http://t.cn/R50e5nn
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD FULL eBOOK INTO AVAILABLE FORMAT ......................................................................................................................... ......................................................................................................................... 1.DOWNLOAD FULL. PDF eBook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... 1.DOWNLOAD FULL. EPUB eBook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... 1.DOWNLOAD FULL. doc eBook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... 1.DOWNLOAD FULL. PDF eBook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... 1.DOWNLOAD FULL. EPUB eBook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... 1.DOWNLOAD FULL. doc eBook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, CookeBOOK Crime, eeBOOK Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • SECRET: Men usually out of emotion, not logic. Take advantage of this and get your Ex back today! See how at: ♥♥♥ http://scamcb.com/exback123/pdf
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

×