@Test public void testDegree() { UGraph<String> graph = graph(); List<List<Node<String>>> unitPartition = new ArrayList<List<Node<String>>>(); unitPartition.add(new ArrayList<Node<String>>(graph.nodes())); assertEquals(2, Nauty.degree(graph.node("a"), unitPartition.get(0))); assertEquals(4, Nauty.degree(graph.node("e"), unitPartition.get(0))); }
public static <L> int degree(Node<L> from, List<Node<L>> to) { int sum = 0; for(Node<L> node : to) sum += from.links(node).size(); return sum; }
Nauty { public static <L> int degree(Node<L> from, List<Node<L>> to) { int sum = 0; for(Node<L> node : to) sum += from.links(node).size(); return sum; } }
Nauty { public static <L> int degree(Node<L> from, List<Node<L>> to) { int sum = 0; for(Node<L> node : to) sum += from.links(node).size(); return sum; }  }
Nauty { public static <L> int degree(Node<L> from, List<Node<L>> to) { int sum = 0; for(Node<L> node : to) sum += from.links(node).size(); return sum; }  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> int degree(Node<L> from, List<Node<L>> to) { int sum = 0; for(Node<L> node : to) sum += from.links(node).size(); return sum; }  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);  }