-
Notifications
You must be signed in to change notification settings - Fork 101
Added New Hypergraph Matching Algorithms #157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
rotshira
wants to merge
53
commits into
pnnl:master
Choose a base branch
from
rotshira:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
53 commits
Select commit
Hold shift + click to select a range
8fa0503
new env
bonicim 88a3c4e
Merge remote-tracking branch 'origin/master'
rotshira d177aab
test+algo
rotshira cf1dd09
test+algo - fix
rotshira 8f13bba
mathcing algo
rotshira 8e4746a
mathcing algo
rotshira ce45e5b
fixed correct doctest
nivmoti 66c59f9
Merge remote-tracking branch 'origin/master'
nivmoti 57f1c81
test
rotshira 91e7142
fixed correct tests
nivmoti 1d47083
Merge remote-tracking branch 'origin/master'
nivmoti 44b897f
update test & algo
rotshira 6be80e5
Merge remote-tracking branch 'origin/master'
rotshira 62c44db
Greedy algorithm implementation
rotshira 37df82a
iterated_sampling algorithm implementation
rotshira 55ae566
iterated_sampling algorithm implementation
rotshira 5dda9d9
HEDCS_matching
rotshira f1ca740
alGo 1+2 WORK
rotshira 44e36bf
matching_algorithms 1+2+3 WORK
rotshira 7b47222
tests classes 1+2+3 WORK
rotshira f2a35df
fix all
rotshira 11b7011
fixed correct tests fixed the functions
nivmoti 277ee71
fixed correct tests fixed the functions vol.2
nivmoti e260887
fixed correct tests fixed the functions vol.3
nivmoti cae3b6b
complete functions with test
nivmoti 4b69793
Tests and algorithm - final
rotshira c71ad7e
Tests - final
rotshira 4f89f00
add logging debug
nivmoti bc359a0
performance comparison
nivmoti ce7df25
performance comparison
rotshira ee479b9
logs
erelsgl ba97f47
logs
erelsgl 1a25284
remove backup folder
erelsgl 26879ae
Website - demonstration of the algorithm
rotshira 8b11a78
website fix
nivmoti 184080b
Turtial notebook
nivmoti 44b7f77
Merge remote-tracking branch 'origin/master'
nivmoti 5f2143d
Update matching_algorithms_tutorial.ipynb
nivmoti 5182eac
fixing problems
nivmoti bd68ec5
fixing problems
nivmoti 44794e6
Merge branch 'master' into master
nivmoti 43bef53
Merge remote-tracking branch 'upstream/master'
nivmoti a9363cd
Merge remote-tracking branch 'origin/master'
nivmoti 244bccd
put the app website
nivmoti e651635
fix problems
nivmoti 239aaac
Matching Algorithms pull changes
nivmoti 98cdb92
Merge branch 'master' into master
erelsgl 48e7b3c
Delete hypernetx/algorithms/cc.py
rotshira 517131c
Update __init__.py
rotshira acb908e
Update Advanced 6 - Hypergraph Modularity and Clustering.ipynb
rotshira cb27fb3
Update Advanced 6 - Hypergraph Modularity and Clustering.ipynb
rotshira b388b91
Update __init__.py
nivmoti 17c6862
Matching Algorithms pull changes
nivmoti File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
Matching Algorithms for Hypergraphs | ||
=================================== | ||
|
||
Introduction | ||
------------ | ||
This module implements various algorithms for finding matchings in hypergraphs. These algorithms are based on the methods described in the paper: | ||
|
||
*Distributed Algorithms for Matching in Hypergraphs* by Oussama Hanguir and Clifford Stein. | ||
|
||
The paper addresses the problem of finding matchings in d-uniform hypergraphs, where each hyperedge contains exactly d vertices. The matching problem is NP-complete for d ≥ 3, making it one of the classic challenges in computational theory. The algorithms described here are designed for the Massively Parallel Computation (MPC) model, which is suitable for processing large-scale hypergraphs. | ||
|
||
Mathematical Foundation | ||
------------------------ | ||
The algorithms in this module provide different trade-offs between approximation ratios, memory usage, and computation rounds: | ||
|
||
1. **O(d²)-approximation algorithm**: | ||
- This algorithm partitions the hypergraph into random subgraphs and computes a matching for each subgraph. The results are combined to obtain a matching for the original hypergraph. | ||
- Approximation ratio: O(d²) | ||
- Rounds: 3 | ||
- Memory: O(√nm) | ||
|
||
2. **d-approximation algorithm**: | ||
- Uses sampling and post-processing to iteratively build a maximal matching. | ||
- Approximation ratio: d | ||
- Rounds: O(log n) | ||
- Memory: O(dn) | ||
|
||
3. **d(d−1 + 1/d)²-approximation algorithm**: | ||
- Utilizes the concept of HyperEdge Degree Constrained Subgraphs (HEDCS) to find an approximate matching. | ||
- Approximation ratio: d(d−1 + 1/d)² | ||
- Rounds: 3 | ||
- Memory: O(√nm) for linear hypergraphs, O(n√nm) for general cases. | ||
|
||
These algorithms are crucial for applications that require scalable parallel processing, such as combinatorial auctions, scheduling, and multi-agent systems. | ||
|
||
Usage Example | ||
------------- | ||
Below is an example of how to use the matching algorithms module. | ||
|
||
```python | ||
from hypernetx.algorithms import matching_algorithms as ma | ||
|
||
# Example hypergraph data | ||
hypergraph = ... # Assume this is a d-uniform hypergraph | ||
|
||
# Compute a matching using the O(d²)-approximation algorithm | ||
matching = ma.matching_approximation_d_squared(hypergraph) | ||
|
||
# Compute a matching using the d-approximation algorithm | ||
matching_d = ma.matching_approximation_d(hypergraph) | ||
|
||
# Compute a matching using the d(d−1 + 1/d)²-approximation algorithm | ||
matching_d_squared = ma.matching_approximation_dd(hypergraph) | ||
|
||
print(matching, matching_d, matching_d_squared) | ||
|
||
|
||
References | ||
------------- | ||
|
||
- Oussama Hanguir, Clifford Stein, Distributed Algorithms for Matching in Hypergraphs, https://arxiv.org/pdf/2009.09605 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add the Matching Algorithm API