Skip to content
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

Pull request (modifiche) #3

Open
wants to merge 24 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: CI

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
workflow_dispatch:
branches: [ "master" ]

jobs:

analyze:
name: Analyze vulnerabilities
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [ 'cpp' ]
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
- name: Autobuild
uses: github/codeql-action/autobuild@v2
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2

build-and-upload:
runs-on: ubuntu-latest
needs: analyze
steps:
- uses: actions/checkout@v3
- name: Build artifacts
run: make
- uses: actions/upload-artifact@v3
with:
name: ri36
path: ri36
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ri3.o
ri36
.vscode
73 changes: 24 additions & 49 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
![](https://img.shields.io/badge/C++-RI-blue.svg?style=flat&logo=c%2B%2B)
![](https://img.shields.io/github/stars/InfOmics/RI)
![](https://img.shields.io/github/forks/InfOmics/RI)
![](https://img.shields.io/github/workflow/status/classy-giraffe/RI/CI)

# RI
***Version: 3.6***
> RI is a general purpose algorithm for one-to-one exact subgraph isomorphism problem maintaining topological constraints.

<hr />

### Description
***RI*** is a general purpose algorithm for one-to-one exact subgraph isomorphism problem maintaining topological constraints. It is both a C++ library and a standalone tool, providing developing API and a command line interface, with no dependencies out of standard GNU C++ library. RI works on Unix and Mac OS X systems with G++ installed, and it can be compiled under Windows using Gygwin. Working graphs may be directed, undirected, multigraphs with optional attributes both on nodes and edges. Customizable features allow user-defined behaviors for attribute comparisons and the algorithm's flow.

***RI*** is a general purpose algorithm for one-to-one exact subgraph isomorphism problem maintaining topological constraints. It is both a C++ library and a standalone tool, providing developing API and a command line interface, with no dependencies out of standard GNU C++ library. ***RI*** works on Unix and Mac OS X systems with G++ installed, and it can be compiled under Windows using Gygwin. Working graphs may be directed, undirected, multigraphs with optional attributes both on nodes and edges. Customizable features allow user-defined behaviors for attribute comparisons and the algorithm's flow.

***RI*** aims to provide a better search strategy for the common used backtracking approach to the subgraph isomorphism problem. It can be integrated with additional preprocessing steps or it can be used for the verification of candidate structures coming from data mining, data indexing or other filtering techniques. RI is able to find graphs isomorphisms, subgraph isomorphisms and induced subgraph isomorphisms. It is distributed in several versions divide chiefly in two groups respectively for static or dynamically changing attributes. All proposed versions are developed taking into account trade-offs between time and memory requirements. Optional behaviors such as stop at first encountered match, processing of result matches, type of isomorphism and additional features may be enabled thanks to high modularity and library's API.
***RI*** aims to provide a better search strategy for the common used backtracking approach to the subgraph isomorphism problem. It can be integrated with additional preprocessing steps or it can be used for the verification of candidate structures coming from data mining, data indexing or other filtering techniques. ***RI*** is able to find graphs isomorphisms, subgraph isomorphisms and induced subgraph isomorphisms. It is distributed in several versions divide chiefly in two groups respectively for static or dynamically changing attributes. All proposed versions are developed taking into account trade-offs between time and memory requirements. Optional behaviors such as stop at first encountered match, processing of result matches, type of isomorphism and additional features may be enabled thanks to high modularity and library's API.

The ***RI*** project also aims to provide a comparison of existing exact subgraph matching algorithms on synthetic and real life graphs. An initial collection of datasets is proposed, it includes synthetic and biological graphs but further types of data regarding other research areas (i.e. engineering, computer vision, etc...) are coming. A list of proposed applications is also given.

Expand All @@ -18,10 +22,15 @@ Please send us an email to get software sources or datasets (see Contacts).

### Usage
##### RI - CLI (Command Line Interface)
Before using the RI command line interface of all distributions, please rebuilt it by make -B
All versions of RI take in input the same parameters:
In order to use RI you must grab an artifact produced by the CI (check the actions tab on GitHub) or manually compile it from scratch.
On Debian-based distributions (Debian, Ubuntu, PopOS etc...):
1. Clone the repository
2. Install the dependencies (G++ and make)
```sudo apt install g++ make```
3. Compile it (you might need to switch to the repository directory by using `cd`)
```make```
```
./ri ISO_TYPE INPUT_FORMAT target_graph pattern_graph
./ri <ISO_TYPE> <INPUT_FORMAT> <target_graph> <pattern_graph>
```
|ISO_TYPE|specify isomorphism|
|---------|-------------------|
Expand All @@ -37,40 +46,6 @@ All versions of RI take in input the same parameters:
|geu |undirected graphs with attributes both on nodes and edges.|
|vfu |Sansone et al. file format for labeled directed graphs with attributes only on nodes.|

<!--
##### Query extractor

Before using the query extractor tool please rebuilt it by digiting `make -B querygen`, then the usage of the built executable is the following:
```
./querygen [gfu gfd] input_graph number_of_nodes number_of_edges output_file number_of_queries
```
The query extractor tries to extract a total amount of number_of_queries subgraphs, from the given input_graph, with the specified number_of_nodes and number_of_edges, saving them at the specified output prefix output_file.

You can set the number_of_nodes or number_of_edges to -1 to do not specify them. For example, let the number_of_edges fixed to a value and the number_of_nodes set to the -1, than the extractor tries to extract a subgraph just with the given number of edges not caring the number of nodes. You can also set number_of_nodes to a decimal value between 0 and 1 to specify it as a percentage of the number_of_edges.

Note that if the input parameters do not reflect the properties of the input_graph you can obtain an unwanted resulting subgraph. So, the extractor tries first to generate a graph with the specified number of edges and the maximum possible number of nodes near to the input value. This does not exclude that a subgraph with the specified number of edges will be extracted.


##### FocusSearch-C++
Before use the FocusSearch-C++ command line interface of all distributions, please rebuilt it by make -B
The tool usage is:

```
./fsearch ISO_TYPE INPUT_FORMAT target_graph pattern_graph
```

|ISO_TYPE|specify isomorphism|
|---------------|------------|
|mono|monomorphism, the classical subgraph matching|

|INPUT_FORMAT| specify input file format|
|---------------|------------|
|gfd |directed graphs with attributes only on nodes.|
|gfu |undirected graphs with attributes only on nodes.|
|vfu| Sansone et al. file format for labeled directed graphs with attributes only on nodes.|

-->

##### Default graph file format

The RI project provides two graph file format gfu and gfd, respectively for undirected and directed graphs with attributes only on nodes.
Expand Down Expand Up @@ -135,19 +110,19 @@ RI is distributed under the MIT license. This means that it is free for both aca
You are free to link or use RI inside source code of your own program. If do so, please reference (cite) RI and this website. We appreciate bug fixes and would be happy to collaborate for improvements.
[License](https://raw.githubusercontent.com/GiugnoLab/RI/master/LICENSE)

<hr />

### Citation
Bonnici, V., Giugno, R., Pulvirenti, A., Shasha, D., & Ferro, A. (2013).
A subgraph isomorphism algorithm and its application to biochemical data.
BMC bioinformatics, 14(7), S13.
```
Bonnici, V., Giugno, R., Pulvirenti, A., Shasha, D., & Ferro, A. (2013).
A subgraph isomorphism algorithm and its application to biochemical data.
BMC bioinformatics, 14(7), S13.

Bonnici V, Giugno R.
On the variable ordering in subgraph isomorphism algorithms.
IEEE/ACM transactions on computational biology and bioinformatics. 2016 Jan 7;14(1):193-203.
<hr />
Bonnici V, Giugno R.
On the variable ordering in subgraph isomorphism algorithms.
IEEE/ACM transactions on computational biology and bioinformatics. 2016 Jan 7;14(1):193-203.
```

### References
if you have used any of the RI project software, please cite the following paper:
If you have used any of the RI project software, please cite the following paper:

Vincenzo Bonnici, Rosalba Giugno, Alfredo Pulvirenti, Dennis Shasha and Alfredo Ferro. A subgraph isomorphism algorithm and its application to biochemical data. BMC Bioinformatics 2013, 14(Suppl 7):S13 doi:10.1186/1471-2105-14-S7-S13.
2 changes: 1 addition & 1 deletion data.geu → datasets/data.geu
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ a
0 2 n
0 2 f
0 3 f
2 3 f
2 3 f
2 changes: 1 addition & 1 deletion data.gfd → datasets/data.gfd
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ a
0 2
0 3
1 2
2 3
2 3
2 changes: 1 addition & 1 deletion query.geu → datasets/query.geu
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ a
3
0 1 f
0 2 n
0 2 f
0 2 f
2 changes: 1 addition & 1 deletion query.gfd → datasets/query.gfd
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ a
3
0 1
0 2
0 2
0 2
3 changes: 1 addition & 2 deletions makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
INCLUDES= -I ./rilib/ -I ./include/
CC=g++
CFLAGS=-c -O3
CFLAGS=-c -O3 -Ofast

SOURCES= ri3.cpp
OBJECTS=$(SOURCES:.cpp=.o)
EXECUTABLE=ri36


all: $(SOURCES) $(EXECUTABLE)

$(EXECUTABLE): $(OBJECTS)
Expand Down
Binary file removed ri36
Binary file not shown.