application: metric

This application introduces finite metric spaces. Functionality includes the computation of the TIGHT_SPAN the split decomposition and in particular a REALIZATION of the metric by a graph::WeightedLabeledGraph.


imports from: common, graph
uses: fan, group, polytope, topaz

Objects

User Functions

  •  
    circle_metric ()

    Gives a metric obtained from a circle of length n

  •  
    metric_cone ()

    gives the metric cone

  •  
    sk_circular_metric ()

    Gives the sk-circular metric defined in the paper optimal realisations of a family of finite metric

  •  
    two_circle_metric ()

    Gives a metric obtained from a two circle of length n connected by an edge

  •  
  •  
    •  
      bipartite_graph_metric ()

      Gives a metric obtained from a bipartite graph with component sizes n1 and n2

    •  
      multipartite_graph_metric ()

      Gives a metric obtained from a multipartite graph where a gives the numbers of elements of each component

    •  
      nex2metric (file) → Metric

      Create a metric from a nexus file.

      Parameters
      Stringfile
      Returns
      Metric
    •  
      points2metric (points) → Metric

      Produces a metric obtained from the l1 (Manhattan) distances of points.

      Parameters
      Matrixpoints
      Returns
      Metric
    •  
      split_metric (n, split) → SparseVector<Rational>

      Computes the split (pseudo) metric of a single split. Output is a vector that can be used as DISTANCES property to obtain a proper metric object.

      Parameters
      Intn
      cardinality of the space
      Set<Int>split
      (only one of the sets has to be given)
      Returns
      SparseVector<Rational>
    •  
      split_system_metric (n, splits) → SparseVector<Rational>

      Computes a metric from a split system splits. Output is a vector that can be used as DISTANCES property to obtain a proper metric object.

      Parameters
      Intn
      cardinality of the space
      Array<Set<int> >splits
      (one of the set for each split)
      Returns
      SparseVector<Rational>
    •  
      split_system_rand_metric (n, splits, b) → SparseVector<Rational>

      Computes a metric from a split system splits assigning each split a random integer weight between 1 and b. Output is a vector that can be used as DISTANCES property to obtain a proper metric object.

      Parameters
      Intn
      cardinality of the space
      Array<Set<Int> >splits
      (one of the set for each split)
      Intb
      Returns
      SparseVector<Rational>
    •  
      weighted_split_system_metric (n, splits) → SparseVector<Rational>

      Computes a metric from a weightend split system splits. Each splits is given as a pair of one of the sets and the weight. Output is a vector that can be used as DISTANCES property to obtain a proper metric object.

      Parameters
      Intn
      cardinality of the space
      Array<Pair<Set<Int>, Rational> >splits
      Returns
      SparseVector<Rational>
  •  
    •  
      thrackle_metric (n) → Metric

      Compute a metric such that the f-vector of its tight span is maximal among all metrics with n points. This metric can be interpreted as a lifting function for the thrackle triangulation (see de Loera, Sturmfels and Thomas: Groebner Basis and triangultaions of the second hypersimplex) and as the the metric obtained by a maximal circular split system.

      Parameters
      Intn
      the number of points
      Returns
      Metric
  •  
    •  
      metric2nex (m, file)

      Convert a polymake metric into a nex-file.

      Parameters
      Metricm
      Stringfile
      default value: standard output