All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.sdmlib.models.pattern.IsomorphismComputation Maven / Gradle / Ivy

Go to download

SDMLib is a light weight modeling library. SDMLib intentionally comes without any tool or editor.

There is a newer version: 2.3.2341
Show newest version
package org.sdmlib.models.pattern;

import de.uniks.networkparser.IdMap;
import de.uniks.networkparser.list.SimpleKeyValueList;

public class IsomorphismComputation
{

   public static boolean calculateMatch(Object graph1, Object graph2, IdMap creators)
   {
      ReachabilityGraph reachabilityGraph = new ReachabilityGraph();
      reachabilityGraph.withMasterMap ( new IdMap().withSession("s").with(creators));

      ReachableState rs1 = new ReachableState().withGraphRoot(graph1).withParent(reachabilityGraph);
      ReachableState rs2 = new ReachableState().withGraphRoot(graph2).withParent(reachabilityGraph);

      Object s1cert = rs1.dynComputeCertificate();
      Object s2cert = rs2.dynComputeCertificate();

      
      return reachabilityGraph.lazyMatch(rs1, rs2) != null;
   }

   public static boolean isIsomorphic(Object graph1, Object graph2, IdMap creators)
   {
      return calculateMatch(graph1, graph2, creators);
   }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy