-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Simple interface to the Concorde solver for the Traveling Salesperson Problem
--
-- This package provides a simple interface to Concorde, a solver for the
-- Traveling Salesperson Problem (TSP). Concorde is available from
-- http://www.tsp.gatech.edu/concorde/index.html.
--
-- This library uses the Lin–Kernighan heuristic via Concorde's
-- linkern program. It quickly produces good tours, which may
-- not be optimal. You can directly control the tradeoff between run time
-- and solution quality.
--
-- An example program is included.
--
-- Currently, only problems in two-dimensional Euclidean space are
-- supported.
--
-- More features of Concorde can be added on request. Feature requests
-- and patches are always welcome.
@package concorde
@version 0.1
-- | Approximate a solution to 2D Euclidean TSP using the Lin-Kernighan
-- heuristic.
module Algorithms.Concorde.LinKern
-- | Approximate a solution to the two-dimensional Euclidean Traveling
-- Salesperson Problem, using the Lin-Kernighan heuristic.
--
-- Invokes Concorde's linkern executable as an external process.
--
-- Note: linkern uses Euclidean distance rounded to the nearest
-- integer. You may need to scale up coordinates in the function passed
-- to tsp.
tsp :: Config -> (a -> R2) -> [a] -> IO [a]
-- | A point in Euclidean two-dimensional space.
type R2 = (Double, Double)
-- | Configuration for tsp.
data Config
Config :: FilePath -> Bool -> Maybe Double -> Maybe Int -> Int -> [String] -> Config
-- | Path to the linkern executable. Searches $PATH by
-- default.
executable :: Config -> FilePath
-- | If set, write progress information to standard output.
verbose :: Config -> Bool
-- | Stop looking for better solutions after this many seconds.
timeBound :: Config -> Maybe Double
-- | Run this many optimization steps. Default is the number of points.
steps :: Config -> Maybe Int
-- | Run this many separate optimizations. Default is 1.
runs :: Config -> Int
-- | Other command-line arguments to the linkern executable.
otherArgs :: Config -> [String]
-- | Default configuration.
defConfig :: Config
instance Eq Config
instance Ord Config
instance Read Config
instance Show Config