Giter Club home page Giter Club logo

ged4py's Introduction

ged4py

ged4py is an implementation of the graph edit distance for Python3 and NetworkX users.

Depreciated

Hi everyone, ged4py was the first part of a larger project: gmatch4py. Gmatch4py is a module that regroup Python implementations -- more particularly using Cython -- of GraphMatching algorithms. Algorithms such as the GED (graph edit distance) using the Munkres algorithms, are included in this new module and is more efficient thanks to Cython. For these reasons, this module won't be maintained anymore !

Feel free to check Gmatch4py at this address : https://github.com/Jacobe2169/GMatch4py

How-to use it ?

First, you need to create (or load) your graphs using NetworkX. In the following example, we built two simple graphs.

import networkx as nx
g=nx.Graph()
g.add_edge("A","B")

g.add_node("C",weight=1)
g2=g.copy()
g.add_edge("A","C")

Then, use the compare function available in the ged4py.algorithm

from ged4py.algorithm import graph_edit_dist
print(graph_edit_dist.compare(g,g2))

Acknowledgments

This library is a modification of the code available at haakondr/graph-edit-distance-python. The core of the code was implemented by him, thus we'd like to thank him !

ged4py's People

Contributors

cgoliver avatar davidhoksza avatar mrmechko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ged4py's Issues

i am getting error

$ python test.py
Traceback (most recent call last):
File "test.py", line 11, in
print(graph_edit_dist.compare(g,g2))
File "C:\Users\ali\Documents\Git\ged4py\ged4py\algorithm\graph_edit_dist.py", line 15, in compare
return ged.normalized_distance()
File "C:\Users\ali\Documents\Git\ged4py\ged4py\algorithm\abstract_graph_edit_dist.py", line 21, in normalized_distance
return self.distance() / avg_graphlen
File "C:\Users\ali\Documents\Git\ged4py\ged4py\algorithm\abstract_graph_edit_dist.py", line 24, in distance
return sum(self.edit_costs())
File "C:\Users\ali\Documents\Git\ged4py\ged4py\algorithm\abstract_graph_edit_dist.py", line 27, in edit_costs
cost_matrix = self.create_cost_matrix()
File "C:\Users\ali\Documents\Git\ged4py\ged4py\algorithm\abstract_graph_edit_dist.py", line 54, in create_cost_matrix
cost_matrix[i,j] = self.substitute_cost(nodes1[i], nodes2[j])
File "C:\Users\ali\AppData\Local\Programs\Python\Python36-32\lib\site-packages\networkx\classes\reportviews.py", line 178, in getitem
return self._nodes[n]
KeyError: 0

i am getting this error message. can you help me ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.