Logo

dev-resources.site

for different kinds of informations.

HyperGraphs In Relation Model

Published at
4/8/2024
Categories
hypergraphs
db
ai
knowledgegraphs
Author
volland
Categories
4 categories in total
hypergraphs
open
db
open
ai
open
knowledgegraphs
open
Author
7 person written this
volland
open
HyperGraphs In Relation Model

In my last article, we model different kinds of graphs in abstract relational databases.

We talk about hypergraphs and even model Undirected hypergraphs. Let's recap our undirected models.

Hypergraph

Undirected Hypergraph

A hypergraph is a mathematical generalization of graphs where a hyperedge could connect multiple or no nodes. So, you have a set of nodes instead of a pair of nodes. Hypergraphs are an emerging domain for modeling complex and dynamic systems and are widely used for temporal and event-dependent graphs. We will model undirected hypergraphs.

Usually, a hypergraph is drawn assets that overlap or as Vin diagrams.

As far as edges now have many-to-many relations with nodes, we just need a joint table.

Nodes

Edges

Edge to nodes

The table could increase if you have a significant edge with a comprehensive set of nodes.

Directed HyperGraph

In directed HyperGraph, we divide nodes into a subset of in-nodes and out-nodes. So, we have a directed edge from one subset to another subset.

We have multiple options for modeling this structure.

As directed, edge-node relations

The most straightforward way is to add a direction attribute to edge-node pairs.

Now Nodes and edges stay the same as in preve example

But relations now has a directions

Pros of this model

  • simplicity
  • ability to create mixed graphs — directed and undirected

Cons of this model

  • it could be hard to build queries
  • The model could encode invalid states. Nobody prevents us from having the same node on the same edge in two directions.
  • for a strictly directed graph we need extra application-level constraints

As directed Graph of nodesets

We could be more explicit and extend a model from a directed graph to operate with node sets

Now, the source and object of the edge point to a node-set relation. For simplicity, we expect that in the case of individual nodes, we create separate node-set for these nodes

Pros of this model

  • more explicit

Cons of this model

  • Require to create a node set for single nodes
  • more complex
db Article's
30 articles in total
Favicon
🛠️ DB Migration For Golang Services, Why it matters? 🐹
Favicon
MongoDb Atlas: manual backup and restore data
Favicon
Import the database from the Heroku dump
Favicon
Why MongoDB? Exploring the Benefits and Use Cases of a Leading NoSQL Database
Favicon
Database Pool Management with Sidekiq and load_async
Favicon
HyperGraphs In Relation Model
Favicon
ACID in DB
Favicon
Use EXISTS instead of COUNT > 0 when checking if records exist
Favicon
Converting MongoDB ObjectId to Timestamp in Snowflake: A Friendly Guide
Favicon
Level UP your RDBMS Productivity in GO
Favicon
Iniciar sesion en mongodb con usuario y contraseña | Mongodb
Favicon
DB POOL
Favicon
Exploring String Field Types in Databases: CHAR, VARCHAR, and TEXT
Favicon
How to connect to MySQL DB
Favicon
How to provision an AWS RDS MySQL Database
Favicon
Amazon RDS for MySQL
Favicon
Amazon Aurora
Favicon
Amazon RDS
Favicon
Understanding the Differences Between SQL and NoSQL Databases
Favicon
Advantages of Relational DB, Graph DB, and RGDB
Favicon
Understanding Foreign Keys in PostgreSQL
Favicon
What's behind scenes of PostgreSQL from Apache AGE?
Favicon
Spring Boot 3 with H2 database example
Favicon
Basic MongoDB Commands
Favicon
Guide to Apache AGE 1.3.0 Release for PostgreSQL 13
Favicon
Laravel useful DB/Eloquent functions:
Favicon
Docker/DB - Isn't it better to set share directory between host and db container?
Favicon
Alojar Wordpress en la nube (Google Cloud)
Favicon
IceFireDB:A database that supports IPFS storage and Redis protocol, interesting direction.
Favicon
MongoDB Complete Backup And Restore Command With Atlas

Featured ones: