congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
State
Code IndexAdd Tabnine to your IDE (free)

How to use
State
in
cascading.flow.planner.iso.finder

Best Java code snippets using cascading.flow.planner.iso.finder.State (Showing top 5 results out of 315)

origin: cwensel/cascading

protected Map<ElementExpression, FlowElement> findMapping( FinderContext finderContext, PlannerContext plannerContext, ElementGraph elementGraph )
 {
 State state = new State( finderContext, plannerContext, matchExpression.getSearchOrder(), matchExpression.getGraph(), elementGraph );
 Map<Integer, Integer> vertexMap = new LinkedHashMap<>();
 boolean match = match( state, vertexMap );
 if( !match )
  return Collections.emptyMap();
 Map<ElementExpression, FlowElement> result = new LinkedHashMap<>();
 for( Map.Entry<Integer, Integer> entry : vertexMap.entrySet() )
  result.put( state.getMatcherNode( entry.getKey() ), state.getElementNode( entry.getValue() ) );
 return result;
 }
origin: cwensel/cascading

 LOG.trace( "begin matching with state: {}", state );
if( state.isGoal() )
 return true;
if( state.isDead() )
 return false;
boolean found = false;
while( !found && ( next = state.nextPair( n1, n2 ) ) != null )
  LOG.trace( "begin matching pair: N1: {}, N2: {}", n1, n2 );
 boolean feasiblePair = state.isFeasiblePair( n1, n2 );
  State copy = state.copy();
  copy.addPair( n1, n2 );
  found = match( copy, vertexMap );
   for( Map.Entry<Integer, Integer> entry : copy.getVertexMapping().entrySet() )
    LOG.trace( "match for feasible pair: N1: {}, N2: {}", n1, n2 );
   vertexMap.putAll( copy.getVertexMapping() );
   copy.backTrack();
origin: cwensel/cascading

protected boolean areCompatibleEdges( int v1, int v2, int v3, int v4 )
 {
 List<ScopeExpression> matchers = matchGraph.getAllEdgesList( v1, v2 );
 // if there is any edge between the nodes, capture all and return true
 if( matchers.size() == 1 && matchers.get( 0 ).acceptsAll() )
  {
  if( LOG.isDebugEnabled() )
   debugCompatibleEdges( elementGraph.getAllEdgesList( v3, v4 ), v1, v2, matchers );
  return true;
  }
 List<Scope> scopes = elementGraph.getAllEdgesList( v3, v4 );
 Collection<Scope> results = areCompatibleEdges( plannerContext, elementGraph.getElementGraph(), matchers, scopes );
 if( LOG.isDebugEnabled() && results != null )
  debugCompatibleEdges( results, v1, v2, matchers );
 return results != null;
 }
origin: cwensel/cascading

assert core2[ node2 ] == NULL_NODE;
if( !areCompatibleNodes( node1, node2 ) )
 return false;
  if( !elementGraph.containsEdge( node2, other2 ) || !areCompatibleEdges( node1, other1, node2, other2 ) )
   return false;
  if( !elementGraph.containsEdge( other2, node2 ) || !areCompatibleEdges( other1, node1, other2, node2 ) )
   return false;
origin: cwensel/cascading

public State copy()
 {
 return new State( this );
 }
cascading.flow.planner.iso.finderState

Javadoc

This class and algorithm is based on the following research.

Cordella, L. P., Foggia, P., Sansone, C., & VENTO, M. (2004). A (sub)graph isomorphism algorithm for matching large graphs. IEEE Transactions on Pattern Analysis and Machine Intelligence, 26(10), 1367–1372. doi:10.1109/TPAMI.2004.75

Implementation in Java, modifications, and bug fixes have been applied.

Keep variable/field naming schemes mirroring the above paper to improve/retain readability.

Thanks to David Jergens for permission allowing use of his VF2State.java in S-Space to help bootstraps this implementation. https://github.com/fozziethebeat/S-Space

Notes:

The #areCompatibleEdges does not scale, but it isn't conceived there will be more than a few edges in any given node pair.

It also accounts for a wild card stating any edge between the nodes is relevant.

Future versions need the ability to specifically match and capture an edge, or all edges that apply to an expression.

Most used methods

  • <init>
  • addPair
  • areCompatibleEdges
  • areCompatibleNodes
  • backTrack
  • copy
  • debugCompatibleEdges
  • getElementNode
  • getMatcherNode
  • getVertexMapping
  • isDead
  • isFeasiblePair
  • isDead,
  • isFeasiblePair,
  • isGoal,
  • nextPair

Popular in Java

  • Creating JSON documents from java classes using gson
  • setScale (BigDecimal)
  • scheduleAtFixedRate (Timer)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now