You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

test.py 1.9 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #export LD_LIBRARY_PATH=.:/export/home/lambertn/Documents/Cython_GedLib_2/lib/fann/:/export/home/lambertn/Documents/Cython_GedLib_2/lib/libsvm.3.22:/export/home/lambertn/Documents/Cython_GedLib_2/lib/nomad
  2. #Pour que "import script" trouve les librairies qu'a besoin GedLib
  3. #Equivalent à définir la variable d'environnement LD_LIBRARY_PATH sur un bash
  4. #Permet de fonctionner sur Idle et autre sans définir à chaque fois la variable d'environnement
  5. #os.environ ne fonctionne pas dans ce cas
  6. import librariesImport, script
  7. #import script
  8. #truc = script.computeEditDistanceOnGXlGraphs('include/gedlib-master/data/datasets/Mutagenicity/data/','collections/MUTA_10.xml',"CHEM_1", "BIPARTITE", "")
  9. #print(truc)
  10. #script.PyRestartEnv()
  11. #script.appel()
  12. def test() :
  13. # script.appel()
  14. script.PyRestartEnv()
  15. # print("Here is the Python function !")
  16. #
  17. # print("List of Edit Cost Options : ")
  18. # for i in script.listOfEditCostOptions :
  19. # print (i)
  20. # print("")
  21. #
  22. # print("List of Method Options : ")
  23. # for j in script.listOfMethodOptions :
  24. # print (j)
  25. # print("")
  26. script.PyLoadGXLGraph('include/gedlib-master/data/datasets/Mutagenicity/data/', 'collections/MUTA_10.xml')
  27. listID = script.PyGetGraphIds()
  28. afficheId = ""
  29. for i in listID :
  30. afficheId+=str(i) + " "
  31. print("Number of graphs = " + str(len(listID)) + ", list of Ids = " + afficheId)
  32. script.PySetEditCost("CHEM_1")
  33. script.PyInitEnv()
  34. script.PySetMethod("BIPARTITE", "")
  35. script.PyInitMethod()
  36. g = listID[0]
  37. h = listID[1]
  38. script.PyRunMethod(g,h)
  39. liste = script.PyGetAllMap(g,h)
  40. print("Forward map : " ,liste[0], ", Backward map : ", liste[1])
  41. print ("Upper Bound = " + str(script.PyGetUpperBound(g,h)) + ", Lower Bound = " + str(script.PyGetLowerBound(g,h)) + ", Runtime = " + str(script.PyGetRuntime(g,h)))
  42. test()

A Python package for graph kernels, graph edit distances and graph pre-image problem.