Class AbstractLayout3DPC<N extends Layout.Node>

    • Constructor Detail

      • AbstractLayout3DPC

        public AbstractLayout3DPC​(Dependence sim)
        Constructor.
        Parameters:
        sim - Similarity measure
    • Method Detail

      • computeSimilarityMatrix

        public static double[] computeSimilarityMatrix​(Dependence sim,
                                                       Relation<? extends NumberVector> rel)
        Compute a column-wise dependency matrix for the given relation.
        Parameters:
        sim - Dependence measure
        rel - Vector relation
        Returns:
        Similarity matrix (lower triangular form)
      • buildSpanningTree

        protected N buildSpanningTree​(int dim,
                                      double[] mat,
                                      Layout layout)
        Build the minimum spanning tree.
        Parameters:
        mat - Similarity matrix
        layout - Layout to write to
        Returns:
        Root node id
      • makeNode

        abstract N makeNode​(int dim,
                            java.util.List<N> children)
      • buildTree

        protected N buildTree​(int[] msg,
                              int cur,
                              int parent,
                              java.util.ArrayList<N> nodes)
        Recursive tree build method.
        Parameters:
        msg - Minimum spanning graph
        cur - Current node
        parent - Parent node
        nodes - Nodes array to fill - must be preinitialized with nulls!
        Returns:
        Tree of nodes
      • maxDepth

        protected int maxDepth​(Layout.Node node)
        Compute the depth of the graph.
        Parameters:
        node - Current node
        Returns:
        Depth
      • findOptimalRoot

        public static int findOptimalRoot​(int[] msg)
        Find the "optimal" root of a spanning tree. Optimal in the sense of: one of the most central nodes.

        This uses a simple message passing approach. Every node that has only one unset neighbor will emit a message to this neighbor. The node last to emit wins.

        Parameters:
        msg - Minimum spanning graph.
        Returns:
        optimal root node.