Small one-dimensional Euclidean preference profiles

We characterize one-dimensional Euclidean preference profiles with a small number of alternatives and voters. We show that every single-peaked preference profile with two voters is one-dimensional Euclidean, and that every preference profile with up to five alternatives is one-dimensional Euclidean if and only if it is both single-peaked and single-crossing. By the work of Chen et al. (Social Choice and Welfare 48(2):409–432, 2017), we thus obtain that the smallest single-peaked and single-crossing preference profiles that are not one-dimensional Euclidean consist of three voters and six alternatives.


Introduction
The one-dimensional Euclidean preference domain (also known as the unidimensional unfolding domain) is a spatial model of structured preferences which originates from economics (Hotelling 1929;Downs 1957), political sciences (Stokes 1963;Brams et al. 2002;Bogomolnaia and Laslier 2007), and psychology (Coombs 1964;Borg et al. 2018). In this domain, the alternatives and the voters are points in a one-dimensional Euclidean space, i.e., on the real line, such that the preference of each voter towards an alternative decreases as the Euclidean distance between them increases.
One-dimensional Euclidean preferences are necessarily single-peaked (Black 1948) and single-crossing (Roberts 1977) as proven by Coombs (1964), Doignon and Falmagne (1994), and Chen et al. (2017). The reverse, however, does not hold. In his work, Coombs (1964) provided a sample preference profile with 16 voters and 6 alternatives that is single-peaked and single-crossing, but not one-dimensional Euclidean. This counterexample seems quite large for real world scenarios. For 1 3 instance, in rank aggregation or winner determination elections, one often either has few alternatives to begin with, or may consolidate by first making a shortlist of only a few alternatives out of many, which will be considered for the final decision. There are also settings where only a few voters are involved, as for instance in a hiring committee or when planning holidays for a family. Hence, a natural question arising in the context of one-dimensional Euclidean preferences is whether for profiles with less than 16 voters or less than 6 alternatives, being single-peaked and singlecrossing is sufficient for being one-dimensional Euclidean. In other words, we are interested in the following question: What are the tight upper bounds on the number of alternatives or voters such that profiles within these bounds are one-dimensional Euclidean as long as they are single-peaked and single-crossing?
We note that all three restricted preference domains (single-peakedness, singlecrossingness, and one-dimensional Euclideanness) can be detected in polynomial time (Doignon and Falmagne 1994). While both, single-peakedness and singlecrossingness, admit direct polynomial-time detection algorithms (Doignon and Falmagne 1994;Escoffier et al. 2008;Elkind et al. 2012;Bredereck et al. 2013), detecting one-dimensional Euclideanness is done via a non-trivial but polynomial-time reduction to linear programming (Doignon and Falmagne 1994;Knoblauch 2010;Elkind and Faliszewski 2014). Moreover, while both, single-peakedness and singlecrossingness, can be characterized by a small finite set of forbidden subprofiles (Ballester and Haeringer 2011;Bredereck et al. 2013), one-dimensional Euclideanness does not have this finite characterization since Chen et al. (2017) showed that there are infinitely many single-peaked and single-crossing preference profiles which are minimally not one-dimensional Euclidean, i.e., excluding any single voter from each of these profiles makes it one-dimensional Euclidean.
We refer to the work of Bredereck et al. (2016) and Elkind et al. (2017) and the literature cited there for further discussion of the single-peaked, the single-crossing, and the one-dimensional Euclidean preference domains.
Our contribution. Recently, Chen et al. (2017) provided a single-peaked and single-crossing profile with three voters and six alternatives which is not one-dimensional Euclidean. In this paper, we show that their counterexample is indeed minimal in terms of the number of voters and the number of alternatives.
In terms of the number of voters, we show that any two single-peaked preference orders are always one-dimensional Euclidean. One way to achieve this would have been to analyze the linear inequalities induced by the linear programs (LP) for detecting one-dimensional Euclideanness (Doignon and Falmagne 1994;Knoblauch 2010;Elkind and Faliszewski 2014). We chose, however, to provide a direct algorithm that, given a single-peaked preference profile with two voters, constructs a concrete one-dimensional Euclidean embedding (see Algorithm 1). The reason for this choice is three-fold.

3
Small one-dimensional Euclidean preference profiles • First, from a social-choice and mathematical point of view, through our approach we not only know that all two-voter single-peaked preference profiles are onedimensional Euclidean but also know that there are one-dimensional Euclidean embeddings of all such profiles which display a certain uniform structure. Note that if we had chosen to analyze the corresponding linear program and tried to show that it is always feasible, we may not be able to have a visual understanding of what the embeddings look like unless we had used an LP solver to solve the induced linear inequalities. Moreover, the embeddings provided by an LP solver may have looked completely different between different profiles. • Second, from an algorithmic point of view, our approach is constructive and does not need any external LP solver. The algorithm is so simple that we can provide a publicly available software for individual checking. As for the number of alternatives, we use the constraint solver CPLEX 1 to show that all single-peaked and single-crossing preferences with up to five alternatives are one-dimensional Euclidean (see Theorem 3). The proof for the second result is computer-aided and can be verified online (see Sect. 4). We note that we did not use the approach given by Doignon and Falmagne (1994), Knoblauch (2010), and Elkind and Faliszewski (2014) to first calculate a linear order of the alternatives and the voters that is consistent to a one-dimensional Euclidean embedding. Instead, our CPLEX program is simply a direct translation of the one-dimensional Euclidean constraints on the variables representing the alternatives and the voters (see Definition 3). The reason for this is that the CPLEX solver offers a function of returning the absolute value of the difference of any two variables, so a linear order of the alternatives and the voters is not necessary to formulate the one-dimensional Euclidean constraints in CPLEX. The verification that every computed embedding is indeed one-dimensional Euclidean is done in a straightforward way, namely by going through each voter' preference order and comparing the distances between the voter's and alternatives' embedded positions.
Identifying the smallest single-peaked and single-crossing preference profile that is not one-dimensional Euclidean not only helps to better understand what precludes a preference profile from being one-dimensional Euclidean, but can also be seen as a necessary step on the way towards a compact characterization via forbidden, albeit not finitely many, subprofiles. We remark that compact characterization via infinitely many forbidden substructures has been done for mathematical concepts such as interval graphs (Lekkerkerker and Boland 1962) and the consecutive ones property in binary matrices (Tucker 1972).
Paper outline. In Sect. 2, we introduce necessary definitions, including singlepeaked and single-crossing preferences, and one-dimensional Euclidean preferences. We also discuss some fundamental observations regarding these domain restrictions. In Sect. 3, we formulate our first main result in Theorems 1 and 2. We prove this result by providing a simple and direct algorithm (see Algorithm 1) that constructs a one-dimensional Euclidean embedding for any two preference orders which are single-peaked. We also provide an example to illustrate Algorithm 1 (see Example 3). In Sect. 4, we provide our second main result by describing the computer program that finds all possible preference profiles with up to five alternatives that are both single-peaked and single-crossing, and uses the CPLEX solver publicly available for researchers to provide a one-dimensional Euclidean embedding for each of these profiles (see Theorem 3). Both the source and the embeddings for all produced profiles (including the verification) are available online from https ://owncl oud.tuwie n.ac.at/index .php/s/nysw1 3YkUa jJpOn and https ://owncl oud.tuwie n.ac.at/index .php/s/Pk8TZ xva48 LJt35 , respectively. For the sake of readability, the proofs of lemmas marked with an asterisk ( * ) have been moved to the appendix.

Definitions and notations
Let A ∶= {1, … , m} be a set of alternatives. A preference order ≻ of A is a linear order of A ; a linear order is a binary relation which is total, irreflexive, asymmetric, and transitive. For two distinct alternatives a and b, the relation a ≻ b means that a is strictly preferred to (or in other words, ranked higher than) b in ≻ . An alternative c is the most-preferred alternative in ≻ if for each alterna- Let ≻ be a preference order over A . We use ⪰ to denote the binary relation which includes ≻ and preserves the reflexivity, i.e., ⪰ ∶ = ≻ ∪{(a, a) | a ∈ A} . For a subset B of alternatives and an alternative c not in B, we use B ≻ c to refer that each b ∈ B is preferred to c in ≻.
A preference profile P specifies the preference orders of some voters over some alternatives. Formally, P ∶= (A, V, R ∶= (≻ 1 , … , ≻ n )) , where A denotes the set of m alternatives, V denotes the set of n voters, and R is a collection of n preference orders such that each voter v i ∈ V ranks the alternatives according to the preference order ≻ i on A . We also assume that no two voters in a preference profile have the same preference order.

3
Small one-dimensional Euclidean preference profiles

Single-peaked preferences
The single-peaked property was introduced by Black (1958) and has since been studied extensively.
Definition 1 (single-peakedness) A preference order ≻ on a set A of alternatives is single-peaked with respect to a linear order ⊳ of A if for each two distinct alternatives b, c ∈ A ⧵ {a * } it holds that where a * is the most-preferred alternative in ≻.
A preference profile P = (A, V, R) is single-peaked if there is a linear order ⊳ of the alternatives A such that the preference order of each voter from V is singlepeaked with respect to ⊳.
Slightly abusing the terminology, we say that two preference orders are singlepeaked if there is a linear order with respect to which each of these two preference orders is single-peaked.
The single-peaked property can be characterized by two forbidden subprofiles, worst-diverse configurations and -configurations (Ballester and Haeringer 2011). The former is defined on three preference orders while the latter is defined on two preference orders. For two arbitrary preference orders, this means that no -configurations are present, implying the following.
Proposition 1 (Ballester and Haeringer 2011) Two preference orders, denoted as ≻ 1 and ≻ 2 , over the set A of alternatives are single-peaked if and only if for all four distinct alternatives u, v, w, z ∈ A such that u ≻ 1 v ≻ 1 w and w ≻ 2 v ≻ 2 u it holds that v ≻ 1 z or v ≻ 2 z.

Single-crossing preferences
The concept of single-crossing profiles dates back to the seventies, when Mirrlees (1971) and Roberts (1977) observed that voters voting on income taxation may form a linear order such that between each two tax rates, the voters that have the same opinion on the relative positions of both rates are either on the top or at the bottom of the linear order.
Definition 2 (single-crossingness) Given a preference profile P = (A, V, R) , a linear order ⊳ of the voters V is single-crossing with respect to a pair {a, b} ⊆ A of alternatives if the set {v i ∈ V | a ≻ i b} is an interval in ⊳ . It is a single-crossing order for P if it is single-crossing with respect to every pair of alternatives.
Preference profile P is single-crossing if it admits a single-crossing order of the voters.
The single-crossing property can be characterized by two forbidden subprofiles, -configurations and -configurations (Bredereck et al. 2013).

One-dimensional Euclidean preferences
) be a preference profile. Let E ∶ A ∪ V → ℝ be an embedding of the alternatives and the voters into the real line where each two distinct alter- voter v i strictly prefers the one closer to him, that is, An embedding E of the alternatives and voters is a one-dimensional Euclidean embedding of profile P if each voter in V is one-dimensional Euclidean with respect to E.
A preference profile is one-dimensional Euclidean if it admits a one-dimensional Euclidean embedding.
Example 1 illustrates the concepts of single-peaked, single-crossing, and one-dimensional Euclidean preferences.
It admits exactly two single-peaked orders, namely 5 ⊳ 4 ⊳ 2 ⊳ 1 ⊳ 3 and the reverse of ⊳ . The single-crossing order of the profile is v 6 ▸ v 5 ▸ v 4 ▸ v 3 ▸ v 1 ▸ v 2 and the reverse of ▸. Note that, in contrast to the single-peaked order, the single-crossing order is unique up to reversal.
The profile is also one-dimensional Euclidean, as shown by the following onedimensional Euclidean embedding.

3
Small one-dimensional Euclidean preference profiles The following observation regarding the relation between single-peaked and single-crossing profiles and the one-dimensional Euclidean representation is also known from the literature (Coombs 1964;Doignon and Falmagne 1994;Chen et al. 2017).
Observation 1 If a profile is one-dimensional Euclidean, then it is also singlepeaked and single-crossing.
Proof It is straightforward to see that if there is a one-dimensional Euclidean representation E of a given profile, then this profile is single-peaked with respect to the order induced by ordering the alternatives increasingly (or decreasingly) according to their values in E. Moreover, it is single-crossing with respect to the order induced by ordering the voters increasingly (or decreasingly) according to their values in E. ◻

Single-peaked preference profiles with two voters
In this section, we formulate and prove our first main result.

Theorem 1 A profile P with two voters is one-dimensional Euclidean if and only if it is single-peaked.
Proof The "only if" part follows from Observation 1. The "if" part follows from Theorem 2. ◻ To complete the proof of Theorem 1, we show the following.

the running time of the multiplication of two integers of O(m) bits each. 2
In the following, in Sect. 3.1, we first present Algorithm 1 and observe some of its technical properties, and in Sect. 3.3 we prove Theorem 2.
In the initialization stage, we embed all inner alternatives (see Definition 4) that are ranked by both voters v 1 and v 2 between their respective most-preferred alternatives, denoted as a 1 and b 1 throughout the whole section; note that a 1 can be equal to b 1 . After that we embed voter v 1 to the right of, and voter v 2 to the left of, the inner alternatives which we have just embedded.
In the iteration stage, we iterate over the remaining alternatives, in order of the preferences of each voter, and try to embed them to the right part of voter v 1 or to the left part of voter v 2 . More specifically, we repeatedly call Refine() to find a range of alternatives and embed them either to the right of the right-most alternative or to the left of the left-most alternative in the embedding. The alternatives are those which are preferred (either by voter v 1 or voter v 2 ) to some already embedded alternatives. If no such alternatives exist, we call Fallback() to find a next alternative less preferred by voter v 1 and embed it to the right of the right-most alternative. See Fig. 1 for an illustration. The single-peaked property, according to Proposition 1, guarantees that the newly embedded alternatives (through either Refine or Fallback) do not alter the one-dimensional Euclidean property.
, only a will be embedded 1 3 Small one-dimensional Euclidean preference profiles

Initialization (lines 2-9 of Algorithm 1)
To describe the initialization stage in more detail, we introduce the notion of inner alternatives.
Definition 4 (Inner alternatives) Let ≻ 1 and ≻ 2 be two preference orders, and let a 1 and b 1 be the most-preferred alternatives of ≻ 1 and ≻ 2 , respectively. The set of inner alternatives of ≻ 1 and ≻ 2 , denoted as (≻ 1 , ≻ 2 ) , is the set of all alternatives that are ranked between a 1 and b 1 by both ≻ 1 and ≻ 2 ∶ Example 2 Consider two preference orders ≻ 1 and ≻ 2 with 1 ≻ 1 2 ≻ 1 3 ≻ 1 4 and 3 ≻ 2 4 ≻ 2 2 ≻ 2 1 . The set of inner alternatives of ≻ 1 and ≻ 2 is We observe the following properties concerning the inner alternatives of two single-peaked preference orders.
(1) For each r ∈ {1, 2} , the most-preferred alternative of ≻ r belongs to Proof The first statement follows from the definition of (≻ 1 , ≻ 2 ). It remains to show Statement (2). If a 1 = b 1 , then by the definition of it holds that (≻ 1 , ≻ 2 ) = {a 1 } = {b 1 } , and the second statement holds immediately since (≻ 1 , ≻ 2 ) has only one alternative. Thus, let us assume that a 1 ≠ b 1 so that | (≻ 1 , ≻ 2 )| ≥ 2 . Let ≻ 1 and ≻ 2 be single-peaked. Suppose, for the sake of contradiction, that there are two distinct alternatives x, y ∈ (≻ 1 , ≻ 2 ) with x ≻ 1 y and x ≻ 2 y-the case with y ≻ 1 x and y ≻ 2 x works analogously. Since a 1 ≻ 1 b 1 and b 1 ≻ 2 a 1 , it follows that x, y ∉ {a 1 , b 1 } . By the definition of a 1 and b 1 and since Now, we are ready to describe the initialization stage of Algorithm 1, where we first embed all inner alternatives (lines 2-7). By Proposition 1, voters v 1 and v 2 have exactly the opposite preferences with respect to these inner alternatives. Hence, by the single-peaked property, the order of the inner alternatives induced by any one-dimensional Euclidean embedding is fixed (up to reverse). In other words, the induced order corresponds to the preferences of either voter v 1 or voter v 2 . Without loss of generality, we choose the induced order to correspond to the preferences of voter v 2 . More precisely, if the preference order of v 2 restricted to the inner alternatives is c 1 ≻ c 2 ≻ ⋯ ≻ c x , where x = | (≻ 1 , ≻ 2 )| , then we let each two consecutive alternatives in ≻ have unit distance. Then, in lines 8-9 we embed voter v 2 to the left of c 1 and v 1 to the right of c x , again at unit distance.
Summarizing, we observe the following about the initialization stage.
Proposition 2 Let E be the embedding constructed by the end of the initialization phase (lines 2-9) of Algorithm 1. Let c 1 , c 2 , … , c x be the embedded alternatives with The following holds. (1) Small one-dimensional Euclidean preference profiles Proof The first three statements follow directly from lines 3-7 and from the definition of (≻ 1 , ≻ 2 ) . Moreover, it holds that E( This implies Statement 4. As to Statement 5, consider an arbitrary embedded alternative c j with j ∈ {1, … , x − 1} . Then, by the second statement, we have that c j ≻ 2 c j+1 . By Lemma 1(2), we have that c j+1 ≻ 1 c j . ◻

The iteration stage (lines 10-13 of Algorithm 1)
After having embedded all inner alternatives and the two voters, the main loop (lines 10-13) extends the embedding by alternatingly placing alternatives that should be embedded to the right of the right-most embedded alternative and alternatives that should be embedded to the left of the left-most embedded alternative. The corresponding procedure is called Refine() (lines 14-25) and is used for both voters v 1 and v 2 . It searches through the alternatives along the preference order of v 1 (resp. v 2 ), and finds all not-yet-embedded alternative(s) C which v 1 (resp. v 2 ) ranks between two already embedded alternatives. To make sure the other not-yet-embedded alternatives can still be embedded at a later stage, we embed the found alternatives C to the right (resp. left) of the right-most (resp. left-most) embedded alternative. The Fallback(≻ 1 , E ) procedure in line 13 guarantees that at least one alternative is embedded during each iteration, thus ensuring that the algorithm terminates.
For an illustration, see the following example.
Example 3 (Illustration for Algorithm 1) Consider the following preference profile with two voters and eight alternatives: It is single-peaked with respect to the order ⊳ with 8 ⊳ 6 ⊳ 5 ⊳ 3 ⊳ 2 ⊳ 1 ⊳ 4 ⊳ 7 , and also with respect to the reverse of ⊳ . Given the two preferences orders as input, our algorithm will return a one-dimensional Euclidean embedding which is depicted in the following line.  Table 1 summarizes how the algorithm proceeds with v 1 and v 2 as input. More precisely, in the initialization, the inner alternatives (≻ 1 , ≻ 2 ) = {1, 2, 3} are embedded between voter v 1 at 4 and voter v 2 at 0.
In iteration 1 of the main loop (lines 10-13), alternative 4 is embedded to the right of voter v 1 in the first call to Refine(≻ 1 , v 1 , E ), as it is the first not-yet-embedded alternative in the preferences of v 1 . Since c 2 = 4 , we set ∶= 2 in line 16. Since c 3 = 2 is an embedded alternative with the smallest index which v 1 ranks lower than 4, we set ∶= 3 in line 18. Next, we set Finally, for k = = 2 we set After alternative 4 has been embedded, alternatives 5 and 6 are embedded to the left of the left-most alternative, namely 3, in the first call to Refine(≻ 2 , v 2 , E). This is because alternatives 5 and 6 are the first not-yet-embedded alternatives in the preference order of v 2 , and there is an embedded alternative, namely 4, such that v 2 prefers {5, 6} to 4. So, ∶= 4 and ∶= 6 , ( − 1) ∶= 3 , and ( ) = 5 + 1 2 . Hence, for k = = 4, For k = + 1 = 5, Fallback(≻ 1 , E ) is not called since at least one of the calls to Refine() returned . In iteration 2, that is, after alternatives 5 and 6 have been embedded, neither Refine(≻ 1 , v 1 , E ) nor Refine(≻ 2 , v 2 , E ) return . Alternative 7 is the first not-yetembedded alternative in the preference order of v 1 . Thus, Fallback(≻ 1 , E ) embeds 7 to the right of v 1 so that it becomes the right-most alternative with ∶= 7:

Table 1
A summary of how Algorithm 1 proceeds for an input of the two preference orders ≻ 1 and ≻ 2 given in Example 3. The first row refers to the ith iteration in the main loop, where i = 0 refers to the initialization. The second row shows exactly which procedure is called with which arguments. The third and the last rows show which alternatives are embedded at which positions in that call At last, in iteration 3, Refine(≻ 1 , v 1 , E ) returns . Then, in Refine(≻ 2 , v 2 , E ), alternative 8 is embedded to the left of the left-most alternative, namely 6, as 8 is the first not-yet-embedded alternative in the preferences of v 2 and there is an embedded alternative, namely 7, such that v 2 prefers alternative 8 to 7. So, ∶= 7 and ∶= 8 , ( − 1) ∶= 5 + 1 2 , and ( ) = 13 + 2 3 . For k = = 7, ◻ Due to the way we embed the alternatives in Refine(≻, v, E ), the newly embedded alternatives do not violate the one-dimensional Euclidean property for voter v, as stated in the following lemma.

Running time of Algorithm 1
We close this subsection by analyzing the running time of Algorithm 1. Clearly, the initialization in lines 2-9 can be done in O(m) time. Recall that the number of alternatives embedded during the initialization phase is p − 1 . Then, the main loop in lines 10-13 terminates after at most m − p + 1 iterations since in each iteration at least one of the calls to Refine(≻ z , v z , E ) with z ∈ {1, 2} or Fallback(≻ 1 , E ) will embed at least one more alternative.
Hence, it remains to analyze the running time of embedding the alternatives via a call to Refine or Fallback. Since each such alternative is embedded exactly once, which needs a constant number of multiplications, additions, and subtractions (see lines 19-23 and line 29), we only need to analyze the running time of the multiplication in the assignments in lines 22-23, as well as the running time of finding the two indices and in lines 16, 18, and 28. Implementation for finding and . A straightforward implementation may require O(m 2 ) time in total to find and in all calls to Refine(≻ z , v z , E ) and Fallback(≻ 1 , E ). However, with a few additional variables we can find them in O(m) time in total in all calls. For brevity's sake, we have left this optimization out of the description of Algorithm 1. A modified version that includes it can be found in Appendix B.1.
Next, we analyze the running time for a possible multiplication in lines 22-23 of Algorithm 2. To this end, let us assume that we store the position of each embedded alternative c i in a integer triple (e i , f i , g i ) such that E(c i ) = e i + f i g i with e i , f i , g i ∈ ℤ and f i < g i . Then, a multiplication in lines 22-23 can be done via integer multiplication, whose running time depends on the largest |e i | + 1 and the largest denominator g i in the triple encoding.

Largest value computed.
To estimate the largest value, we only need to estimate the largest distance from either voter to all alternatives. Observe that in Refine(≻ z , v z , E ), since the distance from v z to each of the newly embedded alternatives is smaller than the distance from v z to c (which is already embedded), the largest distance from v z to any embedded alternative is not increased. The distance from v 3−z to each of the newly embedded alternatives could be enlarged by p, which is the distance between the two voters. The same holds for Fallback(≻ 1 , E ). Hence, the largest distance from either voter to all alternatives is bounded by p ⋅ (m − p + 1) ∈ O(m 2 ).

Largest denominator computed.
As for the largest computed denominator, we observe that it depends on the number of alternatives to be embedded. To this end, let x 1 , x 2 , … , x n , n ≤ m − p + 1 denote the number of alternatives embedded in a successful call of Refine (≻, v, E) . Then, the largest computed denominator is bounded by the following: where the first inequality is due to inequality of arithmetic and geometric means, the second inequality is due to the fact that the total number of alternatives embedded during the iteration stage is bounded by m − p − 1 , the fourth inequality is due to the fact that n ≤ m − p − 1 , and e denotes the Euler number.
Since the multiplication of two integers of value O(e m ) can be done in O(m ⋅ log(m) ⋅ log(log(m))) time (Schönhage and Strassen 1971) and since for each embedded alternative our algorithm performs a constant number of integer multiplications, additions, and subtractions, our algorithm can be implemented to run in O(m 2 ⋅ log(m) ⋅ log(log(n))) time.

Proof of Theorem 2
In Sect. 3.2, we prove the running time stated in Theorem 2. To prove Theorem 2, it remains to prove that Algorithm 1 is correct, i.e., it returns a one-dimensional Euclidean embedding whenever the two input preference orders are single-peaked. To this end, let ≻ 1 and ≻ 2 be the input reference orders with ≻ 1 ∶ a 1 ≻ 1 a 2 ≻ 1 ⋯ ≻ 1 a m and ≻ 2 ∶ b 1 ≻ 2 b 2 ≻ 2 ⋯ ≻ 2 b m . First of all, by Proposition 2, the initialization phase computes a one-dimensional Euclidean embedding of ≻ 1 and ≻ 2 when restricted to the inner alternatives (≻ 1 , ≻ 2 ) . Thus, to prove the correctness, we only need to show that each iteration of the main loop (lines 10-13) extends the embedding in such a way that it is one-dimensional Euclidean for ≻ 1 and ≻ 2 when restricted to the embedded alternatives. To achieve this, we need to show that the procedures Refine(≻ z , v z , E ), z ∈ {1, 2} , and Fallback(≻ 1 , E ), extend the existing one-dimensional Euclidean embedding to one that is one-dimensional Euclidean with respect to the alternatives that have already been embedded and those which are newly embedded. To this end, we introduce a few more technical notions regarding a subset of alternatives.
be an embedding of a two-voter preference profile P = (A, V, R) with V = {v 1 , v 2 } and R = (≻ 1 , ≻ 2 ) . Let A ′ ⊆ A be a non-empty subset of alternatives. We say that E is one-dimensional Euclidean with respect to A ′ if for each voter v z ∈ V and each two alternatives x, y ∈ A � it holds that For each voter v z ∈ V , we use (A � , v z ) to denote the alternative from A ′ which is least preferred by v z , i.e.,

Example 4
Consider the profile from Example 3 again.
For the ease of case distinctions, we introduce another notion called no later than and observe a useful property regarding "no later than". Definition 6 (No later than) For two distinct alternatives x and y, we say that x is embedded no later than y if one of the following conditions holds.
(i) Alternatives x and y are both embedded during initialization. (ii) They are both embedded in the same call to Refine(). (iii) When y is to be embedded, x is already embedded, i.e., E(x) ≠ ⊥.
We say that y is embedded later than x if (i) x is embedded no later than y while (ii) y is not embedded no later than x.
For instance, alternative 5 is embedded later than alternative 4 in Example 3 although they are embedded in the same iteration of the main loop.
The following lemma states that no alternative that is less preferred by both voters will be embedded too early, making sure that the inside-out approach in Refine() is correct.
Lemma 3 ( * ) Let x and y be two distinct alternatives with x ≻ 1 y and x ≻ 2 y . Then, Algorithm 1 embeds x no later than y.
Now, we continue with the correctness proof for the iteration stage. Let D be the alternatives that are embedded at the beginning of Refine or Fallback, and assume that E is one-dimensional Euclidean with respect to D.
In the remainder of the proof, we consider Refine() and Fallback() separately in Sects. 3.3.1 and 3.3.2.

Embedding alternatives in Refine
as otherwise nothing needs to be proved. Let C be the set of alternatives that are to be embedded in the call and let v z ′ be the other voter with z � ∈ {1, 2} ⧵ {z} . By the procedure Refine(≻ z , v z , E ), the two embedded alternatives that Refine identifies are c and c in lines 16 and 18 such that C = {c , c +1 , … , c −1 } and By assumption, the embedding E is one-dimensional Euclidean with respect to D.
One-dimensional Euclideanness regarding voter v z . By Lemma 2, it follows that E is also a one-dimensional Euclidean embedding for voter v z regarding D ∪ C . In particular, it holds that, One-dimensional Euclideanness regarding voter v z ′ . It remains to show that E is also one-dimensional Euclidean for voter v z ′ regarding all alternatives from D ∪ C.
To achieve this, we prove the following two lemmas which ensure that the newly embedded alternatives are one-dimensional Euclidean with respect to voter v z ′.
Lemma 4 ( * ) Assume that the input preference orders ≻ 1 and ≻ 2 are single-peaked. For each not-yet-embedded alternative x, i.e., x ∉ D , it holds that The next lemma states that for each two not-yet-embedded alternatives, the single-peaked property imposes that they are ordered in the same way by both voters.
Lemma 5 ( * ) Assume that the input preference orders ≻ 1 and ≻ 2 are single-peaked. For each two not-yet embedded alternatives x and y, i.e., x, y ∉ D with x ≠ y , the following holds: Now, if we apply Lemma 5 on the alternatives C in the preferences given in (1), we obtain that voter v z ′ 's preferences must be one other alternative, namely c , which is more preferred by v z to (D, ≻ z � ) . This means that there exists no iteration where (D, ≻ z � ) can be embedded, a contradiction.

Embedding alternatives in
We also infer that C = {a } where = |D| + 1 , and that To show the one-dimensional Euclidean property, we only need to show that By lines 28-29, it holds that a * = a −1 . Thus, we infer that By the definition of a * and b * , voter v 1 has preferences Since E is one-dimensional Euclidean with respect to voter v 2 and the alternatives in D, this implies the following: To conclude, we have shown that in each case the algorithm extends the embedding so that the resulting embedding is one-dimensional Euclidean for both voters and the alternatives already embedded as well as the newly embedded alternatives. Thus, our algorithm indeed computes a one-dimensional Euclidean embedding of two voters whose preferences are single-peaked.

Single-peaked and single-crossing profiles with up to five alternatives are one-dimensional Euclidean
In this section, we state and prove our second main result concerning preference profiles with up to five alternatives.

Theorem 3 Each preference profile with up to five alternatives is one-dimensional Euclidean if and only if it is single-peaked and single-crossing.
Proof From Observation 1, we know that a one-dimensional Euclidean profile is necessarily single-peaked and single-crossing. Thus, to show the theorem, it suffices to show that every single-peaked and single-crossing preference profile with up to five alternatives is also one-dimensional Euclidean. We achieve this by using a computer program via the CPLEX solver that exhaustively searches for all possible single-peaked and single-crossing profiles with up to five alternatives and provide a one-dimensional Euclidean embedding for each of them. Since the CPLEX solver accepts constraints on the absolute value of the difference between any two variables, our computer program is a simple one-to-one translation of the onedimensional Euclidean constraints given in Definition 3. Hence, we do not need to compute any single-peaked or single-crossing order necessary for the non-trivial approaches as given in the literature (Doignon and Falmagne 1994;Knoblauch 2010;Elkind and Faliszewski 2014). We did some optimization to significantly shrink our search space on all possible single-peaked and single-crossing preference profiles.
-First, we only consider profiles with at least two alternatives and at least two voters who have pairwise distinct preference orders as two voters with the same preference order can be embedded at the same position without losing the onedimensional Euclidean property. Since the relevant profiles in consideration must be single-crossing, by Doignon and Falmagne (Doignon and Falmagne 1994, Lemma 1) and Bredereck et al. (Bredereck et al. 2013, Section 2.1), our program only searches for profiles with at most m 2 + 1 distinct preference orders, where m is the number of alternatives, 3 ≤ m ≤ 5 . The minimum number of voters we need to consider is three as by Theorem 1 all single-peaked and single-crossing preference profiles with two voters are one-dimensional Euclidean. -Second, we assume that one of the preference orders in the sought profile is 1 ≻ 2 ≻ … ≻ m . We denote this order as the canonical preference order. -Third, using the monotonicity of the single-peaked property, we consider adding a preference order (there are m! − 1 many) to form a potential relevant singlepeaked and single-crossing profile only if it is single-peaked with the canonical one. By Lackner and Lackner (Lackner and Lackner 2017, Theorem 12(i)), among all m! − 1 preference orders other than the canonical one, there are 2m − 2 m − 1 − 1 preference orders that each form with the canonical one a singlepeaked profile. Note that for m = 5 , the number of potentially single-peaked pro-files with n = 5 2 We summarize the number of single-peaked and single-crossing profiles with up to m = 5 alternatives and up to n = m 2 + 1 voters in Table 2. Note that we include profiles which have two voters although by Theorem 1 all single-peaked and singlecrossing preference profile with two voters are one-dimensional Euclidean.
We implemented a program which, for each of these produced profiles, uses the IBM ILOG CPLEX optimization software package to check and find a one-dimensional Euclidean embedding. The verification is done by going through each voter's preference order and checking the condition given in Definition 3. The source code and all generated profiles, together with their one-dimensional Euclidean embeddings and the distances used for the verification, are available online at https ://owncl oud.tuwie n.ac.at/index .php/s/Pk8TZ xva48 LJt35 and can be verified using the software at https ://owncl oud.tuwie n.ac.at/index .php/s/nysw1 3YkUa jJpOn . ◻

Conclusion and outlook
We have shown that for preference profiles with at most five alternatives or at most two voters, being single-peaked and single-crossing suffices for being one-dimensional Euclidean.
Our research leads to some interesting followup questions. First of all, using our computer program from Sect. 4 we can produce all single-peaked and single-crossing preference profiles and all one-dimensional Euclidean preference profiles. A natural question is to count the number of structured (e.g., single-peaked, single-crossing, one-dimensional Euclidean) preference profiles and provide a closed formula in Table 2 For each number m of alternatives stated in the first column and for each number n of voters stated in the first row, 3 ≤ m ≤ 5 and 2 ≤ n ≤ m 2 + 1 , we summarize the number of single-peaked and single-crossing preference profiles we have produced that contain the canonical preference order 1 ≻ 2 ≻ ⋯ ≻ m and no two voters that have the same preference orders. For instance, when m = 3 and n = 4 , the number of sought preference profiles is 2, as indicated in row two and column four terms of the number m of alternatives and the number n of voters, in a similar spirit as recent work by Lackner and Lackner (2017) and Chen and Finnendahl (2018). Second, both the single-peaked and the single-crossing property can be characterized by a few small forbidden subprofiles (Ballester and Haeringer 2011;Bredereck et al. 2013). However, this is not the case for the one-dimensional Euclidean property (Chen et al. 2017). Thus we ask: is it possible to characterize small one-dimensional Euclidean preference profiles via a few forbidden subprofiles? We note that onedimensional Euclidean preferences can be detected in polynomial time, using linear programming (Doignon and Falmagne 1994;Knoblauch 2010). Chen (2016, Chapter 4.11) provided a generic construction and showed that there are at least n! singlepeaked and single-crossing preference profiles with n = m∕2 voters and m alternatives that are not one-dimensional Euclidean. For m = 6 , this number would be 6. However, through our computer program we found that for m = 6 and n = 3 , out of 4179 singlepeaked and single-crossing preference profiles, there are 48 which are not one-dimensional Euclidean. This gap in numbers merits further investigation.
Last but not least, for d ≥ 2 , d-dimensional Euclidean preference profiles are not necessarily single-peaked nor single-crossing (Bogomolnaia and Laslier 2007). In other words, the forbidden subprofiles that are used to characterize single-peaked or single-crossing preference profiles are not of use to characterize d-dimensional Euclidean profiles. Peters (2017) showed that finitely many small forbidden subprofiles are not enough to characterize the d-dimensional Euclidean property for any d ≥ 2 . This leads to the question of searching for compact, sufficient and necessary conditions for preference profiles to be d-dimensional Euclidean. Bogomolnaia and Laslier (2007) answered this question for profiles that may contain ties. Moreover, they showed that for each d ≥ 1 , there exists a non-d-dimensional Euclidean preference profiles with d + 2 voters and d + 2 alternatives. Bulteau and Chen (2020) used a computer program to verify that all preference profiles with up to seven alternatives and up to three voters are 2-dimensional Euclidean, and provided a preference profile with 3 voters and 28 alternatives which cannot be embedded into the two-dimensional space.
Proof By the definitions of and , since E satisfies |E(c −1 ) − E(v z )| < |E(c ) − E(v z )| it holds that Note that ( − 1) and ( ) are defined in lines 19-20 of Algorithm 1. From lines 22-23 of Algorithm 1, it is straightforward to verify that for each alternative c k with − 1 ≤ k ≤ , Combining (13) with (12), we obtain the chain of inequalities in the lemma. ◻

Additional material for section 3.2
Continued discussion on the implementation for j and i Now, we discuss in depth how we achieve the claimed running time of O(m ⋅ -(m)) , using a few additional variables. An extended version of Algorithm 1 where we explicitly state how these variables are initialized and updated can be found in Algorithm 2. The differences are marked in red.
We use a counter , which counts the number of currently embedded alternatives, to test the condition in lines 10, 15, 27 of Algorithm 1 in constant time. Counter is initialized with p − 1 ; recall that the number of inner alternatives embedded during the initialization phase in Algorithm 1 is p − 1.
We introduce two integer arrays 1 and 2 to store for each alternative x the position of x in the preference order of ≻ 1 and ≻ 2 , respectively (see line 33 of Algorithm 2).
For each voter v z , z ∈ {1, 2} , we introduce two integer variables u z and w z which store the following information: (i) u z stores the largest position (i.e., index) in ≻ z among all alternatives that were embedded in the previous call to Refine(≻ z , v z , E). (ii) w z stores the largest position (i.e., index) in ≻ z among all already embedded alternatives.
Both u 1 and u 2 are initialized to 1. w 1 is initialized such that a w 1 = b 1 , while w 2 is initialized such that b w 2 = a 1 (see lines 31 and 40 of Algorithm 2). (12) Small one-dimensional Euclidean preference profiles Assume that we are in a call to Refine(≻ z , v z , E ) with ≻ z ∶ c 1 ≻ z c 2 ≻ z ⋯ ≻ z c m . To find , we go through the preference order of v z , starting from c u z , and increment the value of u z until we find a not yet embedded alternative (see line 49 of Algorithm 2). Then, we set ∶= u z in line 50. We test the condition in line 17 in Algorithm 1 in constant time by checking whether u z < w z since c w z is the alternative with the largest index among all embedded alternatives. If the condition is met, then we find by going through the preference order of v z , starting from c u z and incrementing the value of u z until we find a first already-embedded alternative (see line 52 of Algorithm 2).
We set ∶= u z and u z ∶= − 1 in line 53. We only need to update the value of w z ′ with z � = 3 − z since the largest index among all embedded alternatives in the preference order of v z ′ may have changed (see line 59 of Algorithm 2). We update the counter in line 60 of Algorithm 2.
We also need to adjust Fallback(≻ 1 , E ). By the main loop, when we call Fallback(), both Refine(≻ 1 , v 1 , E ) and Refine(≻ 2 , v 2 , E ) must have returned . This also means that < m and u 1 already points to a first not-yet-embedded alternative in the preference order of v 1 . Hence, we only need to set ∶= u 1 in line 65 of Algorithm 2. We need to update the values of both w 1 and w 2 in line 67 of Algorithm 2, and update the counter in line 68.
It is straightforward to see that the value of variable u z ( z ∈ {1, 2} ) is never decreased and will always be increased by at least the number of alternatives to be embedded in each iteration. Since our algorithm terminates after at most m − p + 1 calls of Refine, the search for and in all calls from the main loop combined needs O(m) time.
Proof Let a * = (D, ≻ 1 ) and b * = (D, ≻ 2 ) . Towards a contradiction, suppose that ≻ 1 and ≻ 2 are single-peaked but x is an alternative with x ∉ D such that This implies that as a 1 ≻ 1 x and b 1 ≻ 2 x ; recall that a 1 (resp. b 1 ) is the alternative most preferred by voter v 1 (resp. v 2 ). Since x is not yet embedded while a * and b * are already embedded, applying Lemma 3 two times (letting y = a * and y = b * , respectively), we know that Together, with the assumption given in (14), we obtain that By the definitions of a 1 and b 1 , we further infer that We distinguish between two cases, in each case aiming to obtain x ∈ (≻ 1 , ≻ 2 ) which is a contradiction to x ∉ D as (≻ 1 , ≻ 2 ) ⊆ D. Case 1: If a 1 = b * , then the preferences given in (18) are equivalent to Furthermore, b 1 ≠ a * as otherwise x ∈ (≻ 1 , ≻ 2 ) -a contradiction. Consequently, the preferences given in (19) imply that Since ≻ 1 and ≻ 2 are single-peaked, by Proposition 1 and by (20), we must have that x ≻ 1 b 1 . However, this implies that x ∈ (≻ 1 , ≻ 2 ) since x ≻ 2 a 1 -a contradiction. Case 2: If a 1 ≠ b * , then the preferences given in (18) imply that Since ≻ 1 and ≻ 2 are single-peaked, by Proposition 1 and by (21), we must have that x ≻ 2 a 1 and x ≻ 1 b 1 , implying that x ∈ (≻ 1 , ≻ 2 ) -a contradiction. ◻ (14) x ≻ 1 a * and x ≻ 2 b * .

Proof of Lemma 5
Lemma 5. Assume that the input preference orders ≻ 1 and ≻ 2 are single-peaked. For each two not-yet embedded alternatives x and y , i.e., x, y ∉ D with x ≠ y, the following holds: For each r ∈ {1, 2} it holds that if x ≻ r y ≻ r (D, ≻ r ) , then (D, ≻ s ) ≻ s x ≻ s y , where s ∈ {1, 2} ⧵ {r}.
Proof Let ≻ 1 and ≻ 2 be single-peaked, and let x, y be as defined in the lemma. Consider an arbitrary index r ∈ {1, 2} such that x ≻ r y ≻ r (D, ≻ r ) holds. Let s ∈ {1, 2} ⧵ {r} . Let (≻ z ) be the most preferred alternative in the preference order ≻ z . Since x, y ∉ D and (≻ z ) ∈ D , we have that By Lemma 4, it follows that (D, ≻ s ) ≻ s {x, y} . Thus, it remains to show that x ≻ s y . Towards a contradiction, suppose that y ≻ s x . By the definition of (D, ≻ s ) , voter v s must have preferences Together with (22), we have a contradiction to Proposition 1. ◻