Package pointgon

Class MWT

java.lang.Object
pointgon.MWT
All Implemented Interfaces:
Serializable, Runnable

public class MWT extends Object implements Runnable, Serializable
Class for the minimum weight triangulation of a pointgon.
Since:
2005.02.18 (Christian Borgelt)
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    processing mode: algorithm mask
    static final int
    splitter identifier: combined 1
    static final int
    splitter identifier: combined 2
    protected int
    order of the perimeter vertices
    static final int
    processing mode: hole distribution flag
    static final int
    splitter identifier: greedy
    protected Vertex[]
    hole vertices (sorted by x-coord.)
    protected int
    processing mode (e.g.
    static final int
    splitter identifier: path
    static final int
    processing mode: precheck flag
    static final int
    processing mode: reverse key flag
    static final int
    splitter identifier: traingle
    protected char[][][]
    flag table for valid triangles
    protected Vertex[]
    perimeter vertices of pointgon
    protected double[][]
    table of edge weights
  • Constructor Summary

    Constructors
    Constructor
    Description
    MWT(Pointgon pgon)
    Create a minimum weight triangulation solver.
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    Get the maximum depth of the recursion.
    Get the edges of the best triangulation.
    Get the holes of the pointgon.
    int
    Get the processing mode.
    long
    Get the number of splits considered.
    long
    Get the number of subproblems visited.
    long
    Get the execution time of the search.
    long
    Get the number of triangles of the best triangulation.
    Get the perimeter vertices of the pointgon.
    double
    Get the weight of the best triangulation.
    static void
    main(String[] args)
    Main program for command line invocation.
    void
    run()
    Run minimum weight triangulation problem solving.
    void
    setMode(int mode)
    Set the processing mode.
    boolean
    Solve minimum weight triangulation problem.
    void
    Stop the minimum weight triangulation problem solving (abort).
    Create a string description of the minimum weight triangulation.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • TRIANGLE

      public static final int TRIANGLE
      splitter identifier: traingle
      See Also:
    • PATH

      public static final int PATH
      splitter identifier: path
      See Also:
    • COMB_1

      public static final int COMB_1
      splitter identifier: combined 1
      See Also:
    • COMB_2

      public static final int COMB_2
      splitter identifier: combined 2
      See Also:
    • GREEDY

      public static final int GREEDY
      splitter identifier: greedy
      See Also:
    • ALGOMASK

      public static final int ALGOMASK
      processing mode: algorithm mask
      See Also:
    • PRECHECK

      public static final int PRECHECK
      processing mode: precheck flag
      See Also:
    • DISTHOLES

      public static final int DISTHOLES
      processing mode: hole distribution flag
      See Also:
    • REVKEY

      public static final int REVKEY
      processing mode: reverse key flag
      See Also:
    • verts

      protected Vertex[] verts
      perimeter vertices of pointgon
    • dir

      protected int dir
      order of the perimeter vertices
    • holes

      protected Vertex[] holes
      hole vertices (sorted by x-coord.)
    • wgts

      protected double[][] wgts
      table of edge weights
    • trtab

      protected char[][][] trtab
      flag table for valid triangles
    • mode

      protected int mode
      processing mode (e.g. DISTHOLES)
  • Constructor Details

    • MWT

      public MWT(Pointgon pgon)
      Create a minimum weight triangulation solver.
      Parameters:
      pgon - the pointgon to triangulate
      Since:
      2005.02.18 (Christian Borgelt)
  • Method Details

    • getMode

      public int getMode()
      Get the processing mode.
      Returns:
      the processing mode
      Since:
      2005.02.18 (Christian Borgelt)
    • setMode

      public void setMode(int mode)
      Set the processing mode.
      Parameters:
      mode - the processing mode
      Since:
      2005.02.18 (Christian Borgelt)
    • getVertices

      public Vertex[] getVertices()
      Get the perimeter vertices of the pointgon.
      Returns:
      the perimeter vertices of the pointgon
      Since:
      2005.02.18 (Christian Borgelt)
    • getHoles

      public Vertex[] getHoles()
      Get the holes of the pointgon.
      Returns:
      the holes of the pointgon
      Since:
      2005.02.18 (Christian Borgelt)
    • getWeight

      public double getWeight()
      Get the weight of the best triangulation.
      Returns:
      the weight of the best triangulation
      Since:
      2005.02.18 (Christian Borgelt)
    • getEdges

      public Edge[] getEdges()
      Get the edges of the best triangulation.
      Returns:
      the edges of the best triangulation
      Since:
      2005.02.18 (Christian Borgelt)
    • getTriangles

      public long getTriangles()
      Get the number of triangles of the best triangulation.
      Returns:
      the number of triangles of the best triangulation
      Since:
      2005.02.18 (Christian Borgelt)
    • getSubprobs

      public long getSubprobs()
      Get the number of subproblems visited.
      Returns:
      the number of subproblems visited
      Since:
      2005.02.18 (Christian Borgelt)
    • getSplits

      public long getSplits()
      Get the number of splits considered.
      Returns:
      the number of splits considered
      Since:
      2005.02.18 (Christian Borgelt)
    • getDepth

      public long getDepth()
      Get the maximum depth of the recursion.
      Returns:
      the maximum depth of the recursion
      Since:
      2005.02.18 (Christian Borgelt)
    • getTime

      public long getTime()
      Get the execution time of the search.
      Returns:
      the execution time of the search
      Since:
      2005.02.18 (Christian Borgelt)
    • solve

      public boolean solve()
      Solve minimum weight triangulation problem.
      Returns:
      whether a solution was found
      Since:
      2005.02.18 (Christian Borgelt)
    • run

      public void run()
      Run minimum weight triangulation problem solving.
      Specified by:
      run in interface Runnable
      Since:
      2005.02.18 (Christian Borgelt)
    • stop

      public void stop()
      Stop the minimum weight triangulation problem solving (abort).
      Since:
      2005.02.18 (Christian Borgelt)
    • toString

      public String toString()
      Create a string description of the minimum weight triangulation.
      Overrides:
      toString in class Object
      Returns:
      the created string description
      Since:
      2005.02.18 (Christian Borgelt)
    • main

      public static void main(String[] args)
      Main program for command line invocation.
      Parameters:
      args - the command line arguments
      Since:
      2005.02.18 (Christian Borgelt)