You are previewing Graph Databases.

Graph Databases

Cover of Graph Databases by Ian Robinson... Published by O'Reilly Media, Inc.
  1. Special Upgrade Offer
  2. Foreword
    1. Graphs Are Everywhere, or the Birth of Graph Databases as We Know Them
  3. Preface
    1. About This Book
    2. Conventions Used in This Book
    3. Using Code Examples
    4. Safari® Books Online
    5. How to Contact Us
    6. Acknowledgments
  4. 1. Introduction
    1. What Is a Graph?
    2. A High-Level View of the Graph Space
      1. Graph Databases
      2. Graph Compute Engines
    3. The Power of Graph Databases
      1. Performance
      2. Flexibility
      3. Agility
    4. Summary
  5. 2. Options for Storing Connected Data
    1. Relational Databases Lack Relationships
    2. NOSQL Databases Also Lack Relationships
    3. Graph Databases Embrace Relationships
    4. Summary
  6. 3. Data Modeling with Graphs
    1. Models and Goals
    2. The Property Graph Model
    3. Querying Graphs: An Introduction to Cypher
      1. Cypher Philosophy
      2. START
      3. MATCH
      4. RETURN
      5. Other Cypher Clauses
    4. A Comparison of Relational and Graph Modeling
      1. Relational Modeling in a Systems Management Domain
      2. Graph Modeling in a Systems Management Domain
      3. Testing the Model
    5. Cross-Domain Models
      1. Creating the Shakespeare Graph
      2. Beginning a Query
      3. Declaring Information Patterns to Find
      4. Constraining Matches
      5. Processing Results
      6. Query Chaining
    6. Common Modeling Pitfalls
      1. Email Provenance Problem Domain
      2. A Sensible First Iteration?
      3. Second Time’s the Charm
      4. Evolving the Domain
    7. Avoiding Anti-Patterns
    8. Summary
  7. 4. Building a Graph Database Application
    1. Data Modeling
      1. Describe the Model in Terms of the Application’s Needs
      2. Nodes for Things, Relationships for Structure
      3. Fine-Grained versus Generic Relationships
      4. Model Facts as Nodes
      5. Represent Complex Value Types as Nodes
      6. Time
      7. Iterative and Incremental Development
    2. Application Architecture
      1. Embedded Versus Server
      2. Clustering
      3. Load Balancing
    3. Testing
      1. Test-Driven Data Model Development
      2. Performance Testing
    4. Capacity Planning
      1. Optimization Criteria
      2. Performance
      3. Redundancy
      4. Load
    5. Summary
  8. 5. Graphs in the Real World
    1. Why Organizations Choose Graph Databases
    2. Common Use Cases
      1. Social
      2. Recommendations
      3. Geo
      4. Master Data Management
      5. Network and Data Center Management
      6. Authorization and Access Control (Communications)
    3. Real-World Examples
      1. Social Recommendations (Professional Social Network)
      2. Authorization and Access Control
      3. Geo (Logistics)
    4. Summary
  9. 6. Graph Database Internals
    1. Native Graph Processing
    2. Native Graph Storage
    3. Programmatic APIs
      1. Kernel API
      2. Core (or “Beans”) API
      3. Traversal API
    4. Nonfunctional Characteristics
      1. Transactions
      2. Recoverability
      3. Availability
      4. Scale
    5. Summary
  10. 7. Predictive Analysis with Graph Theory
    1. Depth- and Breadth-First Search
    2. Path-Finding with Dijkstra’s Algorithm
    3. The A* Algorithm
    4. Graph Theory and Predictive Modeling
      1. Triadic Closures
      2. Structural Balance
    5. Local Bridges
    6. Summary
  11. A. NOSQL Overview
    1. The Rise of NOSQL
    2. ACID versus BASE
    3. The NOSQL Quadrants
    4. Document Stores
    5. Key-Value Stores
    6. Column Family
    7. Query versus Processing in Aggregate Stores
    8. Graph Databases
      1. Property Graphs
      2. Hypergraphs
      3. Triples
  12. Index
  13. About the Authors
  14. Colophon
  15. Special Upgrade Offer
  16. Copyright
O'Reilly logo

Chapter 7. Predictive Analysis with Graph Theory

In this chapter we’re going consider analytical techniques and algorithms for processing graph data. Both graph theory and graph algorithms are mature and well-understood fields of computing science and we’ll demonstrate how both can can be used to mine sophisticated information from graph databases. Although the reader with a background in computing science will no doubt recognize these algorithms and techniques, the discussion in this chapter is handled without recourse to mathematics, to encourage the curious reader to dive in.

Before we look at higher-order analytical techniques we need to reacquaint ourselves with the fundamental breadth-first search algorithm, which is the basis for iterating over an entire graph. Most of the queries we’ve seen throughout this book have been depth-first rather than breadth-first in nature. That is, they traverse outward from a starting node to some end node before repeating a similar search down a different path from the same start node. Depth-first is a good strategy when we’re trying to follow a path to discover discrete pieces of information.

The best content for your career. Discover unlimited learning on demand for around $1/day.