Commit 4cea92b0 authored by Fize Jacques's avatar Fize Jacques

Add MacOS mojave compatibility. Change Readme

parent 217393df
......@@ -105,4 +105,5 @@ venv.bak/
\ No newline at end of file
\ No newline at end of file
......@@ -15,12 +15,11 @@ GMatch4py algorithms were implemented with Cython to enhance performance.
To install `GMatch4py`, run the following commands:
git clone
cd GMatch4py
(sudo) python3 install
$ git clone
$ cd GMatch4py
$ (sudo) python3 install
## Get Started
### Graph input format
......@@ -31,7 +30,7 @@ comes with a large spectrum of parser to load your graph from various inputs : `
### Use Gmatch4py
If you want to use algorithms like *graph edit distances*, here is an example:
# Gmatch4py use networkx graph
import networkx as nx
# import the GED using the munkres algorithm
......@@ -39,7 +38,7 @@ import gmatch4py as gm
In this example, we use generated graphs using `networkx` helpers:
......@@ -48,21 +47,21 @@ All graph matching algorithms in `Gmatch4py work this way:
* Each algorithm is associated with an object, each object having its specific parameters. In this case, the parameters are the edit costs (delete a vertex, add a vertex, ...)
* Each object is associated with a `compare()` function with two parameters. First parameter is **a list of the graphs** you want to **compare**, i.e. measure the distance/similarity (depends on the algorithm). Then, you can specify a sample of graphs to be compared to all the other graphs. To this end, the second parameter should be **a list containing the indices** of these graphs (based on the first parameter list). If you rather compute the distance/similarity **between all graphs**, just use the `None` value.
ged=gm.GraphEditDistance(1,1,1,1) # all edit costs are equal to 1[g1,g2],None)
The output is a similarity/distance matrix :
array([[0., 14.],
[10., 0.]])
This output result is "raw", if you wish to have normalized results in terms of distance (or similarity) you can use :
# or
......@@ -3,6 +3,7 @@ import sys, os, shutil
from distutils.core import setup
from distutils.extension import Extension
import numpy as np
import platform
from Cython.Build import cythonize
from Cython.Distutils import build_ext
......@@ -29,6 +30,16 @@ def scandir(dir, files=[]):
def makeExtension(extName):
global libs
extPath = extName.replace(".", os.path.sep)+".pyx"
## For Mojave Users
if platform.system() == "Darwin":
if "10.14" in platform.mac_ver()[0]:
return Extension(
return Extension(
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment