@Test public void testSearch() { UGraph<String> graph = Graphs.blank(graph(), "x"), orderedA, orderedB; Order order; order = Nauty.order(graph, new NaturalComparator<String>()); orderedA = Graphs.reorder(graph, order); graph = Graphs.reorder(graph, Order.random(graph.size())); order = Nauty.order(graph, new NaturalComparator<String>()); orderedB = Graphs.reorder(graph, order); assertTrue(orderedA.equals(orderedB)); assertTrue(orderedB.equals(orderedA)); }
public static <L> Order order(Graph<L> graph, Comparator<L> comp ) { if(graph instanceof DGraph<?>) return order((DGraph<L>)graph, comp); if(graph instanceof UGraph<?>) return order((UGraph<L>)graph, comp); throw new RuntimeException("Type of graph ("+graph.getClass()+") not recognized"); }
Nauty { public static <L> Order order(Graph<L> graph, Comparator<L> comp ) { if(graph instanceof DGraph<?>) return order((DGraph<L>)graph, comp); if(graph instanceof UGraph<?>) return order((UGraph<L>)graph, comp); throw new RuntimeException("Type of graph ("+graph.getClass()+") not recognized"); } }
Nauty { public static <L> Order order(Graph<L> graph, Comparator<L> comp ) { if(graph instanceof DGraph<?>) return order((DGraph<L>)graph, comp); if(graph instanceof UGraph<?>) return order((UGraph<L>)graph, comp); throw new RuntimeException("Type of graph ("+graph.getClass()+") not recognized"); }  }
Nauty { public static <L> Order order(Graph<L> graph, Comparator<L> comp ) { if(graph instanceof DGraph<?>) return order((DGraph<L>)graph, comp); if(graph instanceof UGraph<?>) return order((UGraph<L>)graph, comp); throw new RuntimeException("Type of graph ("+graph.getClass()+") not recognized"); }  static Order order(Graph<L> graph, Comparator<L> comp ); static Order order(UGraph<L> graph, Comparator<L> comp); static Order order(DGraph<L> graph, Comparator<L> comp); static List<List<Node<L>>> partition(Graph<L> graph, Comparator<L> comp); static List<List<Node<T>>> refine(List<List<Node<T>>> partition); static List<List<Node<L>>> refine(List<List<Node<L>>> partition, List<T> tags); static List<List<Node<L>>> shattering(List<Node<L>> from, List<Node<L>> to); static List<List<Node<L>>> shattering(List<Node<L>> from, List<Node<L>> to, T tag); static boolean shatters(List<Node<L>> from, List<Node<L>> to); static T shatters(List<Node<L>> from, List<Node<L>> to, List<T> tags); static int degree(Node<L> from, List<Node<L>> to); @SuppressWarnings("unchecked") static int degree(Node<L> from, List<Node<L>> to, T tag); static Graph<L> canonize(Graph<L> graph); }
Nauty { public static <L> Order order(Graph<L> graph, Comparator<L> comp ) { if(graph instanceof DGraph<?>) return order((DGraph<L>)graph, comp); if(graph instanceof UGraph<?>) return order((UGraph<L>)graph, comp); throw new RuntimeException("Type of graph ("+graph.getClass()+") not recognized"); }  static Order order(Graph<L> graph, Comparator<L> comp ); static Order order(UGraph<L> graph, Comparator<L> comp); static Order order(DGraph<L> graph, Comparator<L> comp); static List<List<Node<L>>> partition(Graph<L> graph, Comparator<L> comp); static List<List<Node<T>>> refine(List<List<Node<T>>> partition); static List<List<Node<L>>> refine(List<List<Node<L>>> partition, List<T> tags); static List<List<Node<L>>> shattering(List<Node<L>> from, List<Node<L>> to); static List<List<Node<L>>> shattering(List<Node<L>> from, List<Node<L>> to, T tag); static boolean shatters(List<Node<L>> from, List<Node<L>> to); static T shatters(List<Node<L>> from, List<Node<L>> to, List<T> tags); static int degree(Node<L> from, List<Node<L>> to); @SuppressWarnings("unchecked") static int degree(Node<L> from, List<Node<L>> to, T tag); static Graph<L> canonize(Graph<L> graph);  }