Skip to content

Python-based Black Hole Strategy for node removal in MOF graphs using gravity metrics and community detection

Notifications You must be signed in to change notification settings

MehrdadJalali-AI/BlackHole

Folders and files

NameName
Last commit message
Last commit date

Latest commit

3cd3c90 · Mar 13, 2025

History

78 Commits
Sep 12, 2024
Sep 12, 2024
Sep 13, 2024
May 2, 2024
Sep 12, 2024
Dec 16, 2024
Sep 20, 2024
Dec 31, 2024
Sep 20, 2024
Nov 11, 2024
Feb 11, 2025
Mar 13, 2025
Mar 13, 2025
Mar 13, 2025
Mar 13, 2025
Mar 13, 2025
Mar 13, 2025
Mar 13, 2025
Mar 13, 2025
Mar 13, 2025
Mar 13, 2025
Mar 13, 2025
Mar 13, 2025
Sep 13, 2024
Dec 16, 2024

Repository files navigation

Black Hole Strategy in Metal-Organic Framework (MOF) Graph

Black Hole Strategy in Metal-Organic Framework (MOF) Graph based on MOFGalaxyNet

Black Hole Strategy for Node Removal

Overview

This repository contains a Python-based implementation of the Black Hole Strategy applied to community detection in networks. The main goal is to identify and remove nodes from a graph based on a gravity metric, which takes into account degree centrality, betweenness centrality, and edge weights. The method allows for the removal of a percentage of nodes with the lowest gravity in each community based on a specified threshold.

Demo!

Below is an example of the Black Hole Strategy in action, showing the graph as nodes are highlighted based on their gravity:

Black Hole Strategy in Metal-Organic Framework (MOF) Graph based on MOFGalaxyNet

How it Works

  1. Community Detection: First, the graph is divided into communities using the Girvan-Newman algorithm.
  2. Gravity Calculation: For each community, the gravity score for each node is computed using normalized degree centrality, betweenness centrality, and edge weights.
  3. Stratified Sampling: Nodes are categorized into bins according to their PLD (Pore Limiting Diameter) values, and a proportional number of nodes are selected from each bin to maintain the PLD distribution. (PLD, being a critical parameter in MOFs data, can be substituted or complemented by other properties depending on the application.)
  4. Node Removal: Nodes with the lowest gravity are removed based on a configurable threshold, representing the percentage of nodes to be removed in each community.
  5. Results: The remaining nodes are analyzed, and the reduced graph is visualized.

MOFGalaxyNet and Black Hole Strategy

About

Python-based Black Hole Strategy for node removal in MOF graphs using gravity metrics and community detection

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published