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
A finite metric space. Distance values can be given as Vector in DISTANCES (lexicographically ordered) or as a DISTANCE_MATRIX.
Properties of Metric
- BLOCK_DECOMPOSITION: common::Array<Pair<Array<Int>, Matrix<Scalar, NonSymmetric>>>
The block decomposition of the metric space.
- REALIZATION: graph::WeightedLabeledGraph<Scalar>
A graph::WeightedLabeledGraph realizing the metric space.
- TIGHT_SPAN_GRAPH: graph::WeightedLabeledGraph<Scalar>
The graph of the TIGHT_SPAN as graph::WeightedLabeledGraph
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
- combination (G ...) → WeightedLabeledGraph
Combine several weighted labeled graphs and identify nodes with identical labels
- split_decomposition (D) → Array<Pair<Set,Rational> >
Computes the split decomposition of a metric D (encoded as a symmetric distance matrix).
- 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
- points2metric (points) → 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
Int n cardinality of the spaceSet<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
Int n cardinality of the spaceArray<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
Int n cardinality of the spaceArray<Set<Int> > splits (one of the set for each split)Int b 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
Int n cardinality of the spaceArray<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.
- metric2nex (m, file)