% \documentclass{uai2022} % for initial submission
\documentclass[accepted]{uai2022} % after acceptance, for a revised
                                    % version; also before submission to
                                    % see how the non-anonymous paper
                                    % would look like
%% There is a class option to choose the math font
% \documentclass[mathfont=ptmx]{uai2022} % ptmx math instead of Computer
                                         % Modern (has noticable issues)
% \documentclass[mathfont=newtx]{uai2022} % newtx fonts (improves upon
                                          % ptmx; less tested, no support)
% NOTE: Only keep *one* line above as appropriate, as it will be replaced
%       automatically for papers to be published. Do not make any other
%       change above this note for an accepted version.

%% Choose your variant of English; be consistent
\usepackage[american]{babel}
% \usepackage[british]{babel}

%% Some suggested packages, as needed:
\usepackage{natbib} % has a nice set of citation styles and commands
    \bibliographystyle{plainnat}
    \renewcommand{\bibsection}{\subsubsection*{References}}
\usepackage{mathtools} % amsmath with fixes and additions
% \usepackage{siunitx} % for proper typesetting of numbers and units
\usepackage{booktabs} % commands to create good-looking tables
\usepackage{tikz} % nice language for creating drawings and diagrams

\usepackage{xspace}
\usepackage{makecell}
\usepackage{threeparttable}
\usepackage{amsmath,amsfonts,amsthm,mathtools}
\usepackage{algorithm,algorithmic}
\usepackage[inline]{enumitem}
\usepackage{todonotes}
\usepackage{pgfplots}


%% Provided macros
% \smaller: Because the class footnote size is essentially LaTeX's \small,
%           redefining \footnotesize, we provide the original \footnotesize
%           using this macro.
%           (Use only sparingly, e.g., in drawings, as it is quite small.)

%% Self-defined macros
\newcommand{\swap}[3][-]{#3#1#2} % just an example
\newcommand{\FairProb}{{\sc FairProb}\xspace}
%\newcommand{\IsFairNonZero}{{\sc IsFairProbNonZero}\xspace}
%\newcommand{\IsFairOne}{{\sc IsFairProbOne}\xspace}
\newcommand{\HighProb}{{\sc HighestProb}\xspace}
\newcommand{\ExFairNonZero}{{\sc ExistsPossiblyFair}\xspace}
\newcommand{\ExFairOne}{{\sc ExistsCertainlyFair}\xspace}
\newcommand{\zihao}[1]{\textcolor{blue}{#1}}
\newcommand{\xiaohui}[1]{\textcolor{red}{#1}}
\newcommand{\zz}[1]{\textcolor{purple}{#1}}

\newtheorem{theorem}{Theorem}[section]
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{conjecture}[theorem]{Conjecture}
\newtheorem{claim}[theorem]{Claim}

\theoremstyle{definition}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{example}[theorem]{Example}
\newtheorem{fact}[theorem]{Fact}

\newcommand{\RR}{\mathbb{R}}

\theoremstyle{remark}
\newtheorem*{remark}{\rm \bf Remark}
\newtheorem*{remarkMagenta}{\rm \bf \magenta{Remark}}


\title{Proportional Allocation of Indivisible Resources under Ordinal and Uncertain Preferences}

% The standard author block has changed for UAI 2022 to provide
% more space for long author lists and allow for complex affiliations
%
% All author information is authomatically removed by the class for the
% anonymous submission version of your paper, so you can already add your
% information below.
%
% Add authors
\author[1]{\href{mailto:<zihao004@e.ntu.edu.sg>}{Zihao Li}{}}
\author[1]{Xiaohui Bei}
\author[1]{Zhenzhen Yan}
% \author[1]{\href{mailto:<jj@example.edu>?Subject=Your UAI 2022 paper}{Jane~J.~von~O'L\'opez}{}}
% \author[1]{Harry~Q.~Bovik}
% \author[1,2]{Further~Coauthor}
% \author[3]{Further~Coauthor}
% \author[1]{Further~Coauthor}
% \author[3]{Further~Coauthor}
% \author[3,1]{Further~Coauthor}
% Add affiliations after the authors
\affil[1]{%
    School of Physical and Mathematical Sciences\\
    Nanyang Technological University\\
    Singapore
    % Computer Science Dept.\\
    % Cranberry University\\
    % Pittsburgh, Pennsylvania, USA
}
% \affil[2]{%
%     Second Affiliation\\
%     Address\\
%     …
% }
% \affil[3]{%
%     Another Affiliation\\
%     Address\\
%     …
%   }
  
  \begin{document}
\maketitle

\begin{abstract}
    We study a fair resource allocation problem with indivisible items.
  The agents' preferences over items are assumed to be ordinal and have uncertainties.
   %in which agents' preferences over the items are ordinal and have uncertainties.
 % In this problem, each agent has a probability distribution of ordinal preferences over the items.
  % We adopt stochastic dominance proportionality as our fairness notion and
  We adopt stochastic dominance proportionality as our fairness notion and study a sequence of problems related to finding allocations that are fair with a high probability. We provide complexity analysis for each problem and efficient algorithms for some problems. Finally, we propose several heuristic algorithms to find an allocation that is fair with the highest  probability. We thoroughly evaluate the performance of the algorithms on both synthetic and real datasets.
\end{abstract}

\section{Introduction}
The problem of fairly allocating a set of scarce resources among multiple agents has been a central research topic in multi-agent systems and AI.
One of the most prominent fairness notions in fair division is \emph{proportionality}, which states that each agent should receive enough resources which are at least $1/n$ of the utility when she receives all the resources, where $n$ is the total number of the agents. Proportionality is one of the first studied fairness concepts in the literature. 
% A proportional allocation is also sometimes referred to as a ``simple fair division''. 
The existence of a proportional allocation can always be guaranteed when the resources are divisible. However, with indivisible items, proportional allocations may fail to exist in some cases; a simple example is when there are only two agents and one item which both agents valued positively.

A classic notion of proportionality is defined under the setting that each agent has a \emph{cardinal} and \emph{deterministic} valuation function over the items. In contrast, this paper studies \emph{ordinal} and \emph{uncertain} preferences over items.
%However, this is not the necessary case when agents' knowledge about their valuations is limited and uncertain. In many contexts, agents may only have \emph{ordinal} preferences over the items. 
Considering only ordinal preferences is a natural and appealing assumption due to several reasons. To name a few, first, it is often much easier to elicit ordinal preferences from the agents since it requires significantly less information. Second, some weaker fairness notions defined for ordinal preferences may permit more positive computational results for many problems. Finally, in certain applications, 
% (\zz{zz: can you name a few applications?})
 it's not available to get the cardinal preferences due to agents' limited knowledge on their valuations.
In fact, the ordinal preferences have been widely studied in the resource allocation problems%There are extensive studies of resource allocation under ordinal preferences
~\citep{kuhn1955hungarian,gardenfors1973assignment,demko1988equitable,bogomolnaia2001new,burkard2009assignment,david2013algorithmics,aziz2019efficient}.
%In this work, we adopt several fairness notions from~\citet{aziz2015fair} that generalize proportionality to ordinal setting based on \emph{stochastic dominance (SD)}.

The assumption of uncertain preferences is also practical.
%In addition to agents only having ordinal preferences, 
In some settings the ordinal preferences may not be completely known due to a lack of information or a high cost to elicit a full preference list.
Specifically, it may require a large number of pairwise comparisons among possible options to get the full preference order.  It can also be difficult to even rank two close options without additional costly information~\citep{DBLP:conf/aaai/DrummondB14}.
In addition, according to the study of uncertain preferences in \citep{aziz2019pareto}, %the agents we consider may be some virtual agents whose 
an agent's preference may be a composition of several preference lists from other agents she represents, or 
%the agents' preference may be 
a combination of preferences from different criteria, where their weights are not determined.
% \todo[inline]{Add more explanations about the uncertainty model.}


%Thus, in this work we will also consider uncertainties in agents' preferences. 
In summary, the problem studied in this paper is to find a fair allocation for agents that have ordinal and uncertain preferences over items. In particular, the notion to define fairness under ordinal preferences is based on \emph{stochastic dominance (SD)}, a standard way of comparing fractional allocations. We model the uncertain preferences following a similar way as in \citet{aziz2019pareto} and ~\citet{aziz2016stable}. Specifically, 
we use tied sets to represent the items that the agents are not sure of their preferences towards and assume equal probabilities over each linear order extension of the preference order in the tied sets. This model of uncertainty is common for ordinal preferences.
%in the case that an agent's preference is a weak order that contains ties, we assume equal probabilities over each linear order extension of the order. 
%More specifically, we adopt an uncertain ordinal preference model considered in \citet{aziz2019pareto} and ~\citet{aziz2016stable}, where the preference of an agent is a weak order that may contain ties, and each linear order extension of the weak order is assumed to be equally possible. Note that only the distributions of agents' preferences are known before the allocation, and the realizations of the preferences are revealed only after the allocation.
It has also been widely used in the matching literature \citep{DBLP:conf/sigecom/RastegariCIL13,DBLP:conf/sigecom/RastegariCIIL14,DBLP:conf/aaai/DrummondB14}. To the best of our knowledge, this paper is the first one to consider fair allocations under such preference settings and provide algorithmic and complexity analysis for it.
% This model of uncertainty has been used in several practical problems, such as the Hospital/Resident matching problem with Ties (HRT)~\citep{irving2000hospitals,diebold2017matching} and school/student matching problem~\citep{abdulkadiroglu2006changing}.
% Ties in preferences with breaking randomly into a linear order extension are often used in school choice towards students.}
\subsection{Our results}

In this work, we study how to find proportionally fair allocations when the agents have ordinal and uncertain preferences. %\zihao{which is the first work to consider fair allocations under ordinal and uncertain preferences to the best of our knowledge}.
% In this paper, we focus on one uncertain preference: the ordinal preference with ties\footnote{ It is also called compact indifference model in some works\cite{aziz2019pareto}}.
Inspired by~\citet{aziz2017pareto} which studies Pareto optimal allocations under similar preference models, we study the computational complexity of the following four problems:

\begin{itemize}%\itemsep1ex
\item \FairProb: What is the probability that a given allocation is fair under the specific fairness definition?
% \item \IsFairNonZero: for a given allocation, is the fair probability of this allocation non-zero?
% \item \IsFairOne: for a given allocation, is the fair probability of this allocation one?
\item \ExFairNonZero: Does there exist an allocation that is fair with non-zero probability?
\item \ExFairOne: Does there exist an allocation that is fair with probability one?
\item \HighProb: How to find an allocation with the highest probability of being fair under the specific fairness definition?
\end{itemize}

We focus on two fairness notions introduced in~\citet{aziz2015fair}: weak SD proportionality and SD proportionality. Other proportional notions are also discussed in~\citet{aziz2015fair}. But they are shown to be equivalent to either of these two fairness notions. For each fairness notion, we present hardness results and efficient algorithms for the above four questions. Specifically, we show that for both fairness notions, \FairProb  and \ExFairNonZero can be solved in polynomial time via dynamic programming and matching.
\ExFairOne and \HighProb are NP-hard. But we can provide polynomial-time algorithms for some special cases. For instance, if the number of agents is constant or the agents are all identical, we can efficiently find an allocation satisfying the corresponding condition.
We summarize all the theoretical findings %detailed results are summarized 
in Table \ref{res}.

\begin{table*}[t]
	\centering	
	\caption{Theorectical results}
    %\renewcommand\tabcolsep{5.0pt}
	\begin{threeparttable}
        \scalebox{0.9}{
		\begin{tabular}{|l|l|l|}
			\hline
			& Weak SD Proportionality & SD Proportionality \\
			\hline
			\makecell[l] {\FairProb
            % \\ \IsFairNonZero \\ \IsFairOne
            } & in P (Thm \ref{thm:wsdp_fp}) & in P (Thm \ref{thm:sdp_fp}) \\
			\hline
			\ExFairNonZero & in P (Thm \ref{thm:wsdp_epfa2}) & in P (Thm \ref{thm:sdp_epfa2}) \\
			\hline
			\ExFairOne & \makecell[l] {NP-Hard (Thm \ref{thm:wsdp_ecfa2}) \\
			in P for constant $n$ (Thm \ref{thm:wsdp_awhfpfpt})\\
			in P for identical agents (Thm \ref{thm:wsdp_ecfas})} &
			\makecell[l] {NP-Hard (Thm \ref{thm:sdp_ecfa2}) \\
			in P when the number of equivalent classes \\
			is at most 4 in all preferences. (Thm \ref{thm:sdp_ecfa4})} \\
			\hline
            \makecell[l] {\HighProb} &
			\makecell[l] {NP-hard (Thm \ref{thm:wsdp_ecfa2})\\
			 in P for constant $n$ (Thm \ref{thm:wsdp_awhfpfpt})} & NP-hard (Thm \ref{thm:sdp_ecfa2})\\
			\hline
		\end{tabular}}
        % \begin{tablenotes}
        %     \item[1] It's still NPC when the number of equivalent classes is $\geq 6$ and there exists polynomial algorithm when the number of equivalent classes is $\leq 4$.(\ref{cor:sdp_ecfa3},\ref{thm:sdp_ecfa4})
        % \end{tablenotes}
	\end{threeparttable}

    \label{res}
\end{table*}

Finally, noted the importance of \HighProb in many real-world scenarios, %Despite the hardness results, in the last section 
we propose several heuristic algorithms to find an allocation that is fair with a high probability. Experiments in both synthetic and real datasets are conducted to evaluate their performance and computation efficiency.

% In this paper, we present several results in two proportionality concepts called Weak SD Proportionality and SD Proportionality, and also gives some parameterized algorithms or polynomial algorithms for the special cases.

% For \HighProb \, in Weak SD Proportionality, we propose some different approximation algorithm and compare the performance and the running time in both synthetic and real datasets.

\subsection{Related Works}
% Proportionality is one of the most established fairness concepts in fair division.
% \todo[inline]{this sentences appear before, delete?}
In most existing literature, agents are assumed to have \emph{cardinal} and \emph{deterministic} valuations over items~\citep{lipton2004approximately,brams2012maxsum,bouveret2008efficiency,bezakova2005allocating}.


Several works have considered ordinal preferences and weaker fairness notions~\citep{kuhn1955hungarian,gardenfors1973assignment,demko1988equitable,bogomolnaia2001new,burkard2009assignment,david2013algorithmics,aziz2015fair,segal2020fair,bouveret2010fair}.
\citet{aziz2015fair} is the most related one. They used the stochastic dominance relation between fractional allocations to define various generalized notions of proportionality and envy-freeness and investigated the computational complexity of finding a fair assignment. 
They assume preferences are completely known and consider possibly indifferent preferences over items. In contrast, we assume that agents have strictly different preferences for different items but their preferences may not be completely known.  We name the set of items with unknown preferences a tie. We model the preferences for items in a tie using uniformly distributed linear order extensions. %Technically, our paper provides a more refined analysis of the computational complexity for the allocation problem. 
It is worthwhile to note that assuming indifference for items with unknown preference can be regarded as an alternative way to model the uncertain preference. But we show that the fair allocation from such a modeling perspective %The fair allocation studied in their work 
can only be mapped to the certainly and possibly fair allocation in weak SD proportionality and SD proportionality, respectively in our work, after some small modifications. %strict  but uncertain preferences and use ties to capture the uncertainty.

%\zihao{In their work, the preferences of agents towards items are certain but may have indifferences, where we consider strict but uncertain preferences and we use the ties to capture the uncertainty. Though we adopt similar models which use an ordinal list with ties to represent preferences, these two models are different both conceptually and technically. Detailedly, from a conceptual perspective, we assume the preferences over the items in one tie are different but not known, where they are indifferent in their work. From a technical perspective, our work provides a more refined analysis, where the fair allocation in their work is just a similar case as certainly and possibly fair allocation in weak SD proportionality and SD proportionality respectively in our work.} 
% these two models are different both conceptually and technically. Detailedly, if we simply treat uncertainties as indifferences and use the approaches from \citet{aziz2015fair}, it may lead to allocations with a very low probability of being fair in our model, where we aim to find allocation with high fair probabilities.}
% \todo[inline]{Further explanation between our work and this work.}
% Besides, \citet{segal2020fair} proposed new notions of proportionality based on a special preference extension called diminishing difference and developed algorithms for finding such proportional allocations.

Another stream of related literature considers uncertainties in agents' knowledge about their valuations~\citep{lumet2012fair,aziz2016stable,aziz2017pareto,aziz2017stable,aziz2019pareto,menon2018robust}.
The most related ones are~\citet{aziz2019pareto} and ~\citet{aziz2017pareto}, in which they study a Pareto optimal assignment problem. In their problem, agents also express ordinal and uncertain preferences. We adopt the way how they model the uncertain preferences but study a proportionally fair allocation problem. %They presented both algorithmic and complexity results under several uncertainty models. The model we adopt in this work is the compact indifference model from their works. 
\citet{lumet2012fair} considered a different fair division uncertainty model in which each item could be in either good or bad state with certain probabilities. They developed algorithms to find ex-post fair allocations assuming independent states over items and correlated valuations over agents. %They assume the states of the items are independent and the agent valuations are related, while our work assumes the opposite.
Different from their paper, we assume the states of the items are correlated but the agent valuations are independent.


\section{Preliminaries}

Consider an allocation problem instance with a set of $n$ agents $N=\{1,\ldots,n\}$ and a set of $m$ indivisible items $O=\{o_1,\ldots,o_m\}$.
Each agent $i$ has a complete and transitive strict preference order $\succ_i$ over $O$. The \emph{ranking} of an item for an agent is defined as the sequence of the item in the agent's preference list. Specifically, an item's ranking in an agent's preference equals the number of items preferred by the agent plus one.
An \emph{allocation} is a partition of items into $n$ bundles $A= (A_1, \ldots, A_n)$, such that each agent $i$ is allocated a bundle $A_i$. We also denote $[p]$ as the set $\{1, \ldots ,p\}$ for any positive integer $p$.

\noindent\textbf{Uncertainty in Preferences.}
In this work, we allow agents to express uncertainty in their preferences in terms of ``ties''. Specifically, we adopt an uncertainty model considered in \citet{aziz2016stable} and \citet{aziz2019pareto} (termed as a \emph{compact indifference model} in their paper).
%\cite{aziz2016stable,aziz2017pareto,aziz2019pareto} considered several uncertain preferences models focus on other concepts, here we will focus on the uncertain model which is called Compact Indifference Model.
In this model, each agent $i$ is allowed to report a weak preference list. 
%denoted by $\succ'_i$: 
For instance, consider such a preference list $(S_{i,1})\succ_i \ldots\succ_i (S_{i,k_i})$. Each $S_{i,j}$ is a tied set in the weak preference list that we call the $j$th \emph{equivalent class} of agent $i$.
The actual strict preference $\succ_i$ of agent $i$ is then chosen uniformly at random from all linear order extensions of this weak order.
The choices of the linear order extensions of different agents are independent. We denote $k_i$ as the number of equivalent classes of agent $i$.

\paragraph{Example 1.}
% \begin{example}\label{example1}
Consider the following allocation problem with $2$ agents and $4$ items: agent 1 has preference $(a,b)\succ_1(c,d)$, agent 2 has preference $(a)\succ_2(b,c,d)$.
In this instance, the strict preference of agent $1$ may be $a\succ_1b \succ_1c \succ_1d$ or $a \succ_1 b \succ_1 d \succ_1 c$ or $b \succ_1 a \succ_1 c \succ_1 d$ or $b \succ_1 a \succ_1 d \succ_1 c$, each with probability $1/4$,
while the strict preference of agent $2$ may be $a \succ_2 b \succ_2 c \succ_2 d$ or $a \succ_2 b \succ_2 d \succ_2 c$, or the rest $4$ preferences generated by the permutation of $b,c,d$, each with probability $1/6$.

\noindent\textbf{Proportional Fairness.}
% One of the most prominent fairness notions in fair division is \emph{proportionality}, which says that each agent should get at least the average of the total utility (with respect to her own valuation).
% However, this notion is defined based on the agents having cardinal utilities. 
When only ordinal preferences are available, \citet{aziz2015fair} defined several fairness notions that generalize proportionality to the ordinal setting. In this work we consider the following two definitions based on \emph{stochastic dominance(SD)}.%in two equivalent classes.

\begin{itemize}
%    \item[1(a)] \emph{Possibly proportionality}: an allocation satisfies \emph{possibly proportionality} if there exists a set of cardinal utilities consistent with the agents' preferences for which the allocation is proportional.
    \item \emph{Weak Stochastic Dominance (SD) proportionality}: an allocation satisfies \emph{weak SD proportionality} if for each agent $i$, there exists $1 \leq k \leq m$ such that agent $i$ is allocated at least $\lfloor \frac{k}{n}+1 \rfloor$ of her top $k$ items.
 %   \item[2(a)] \emph{Necessary porportionality}: an allocation satisfies \emph{necessary proportionality} if it is proportional for all cardinal utilities consistent with the agents' preferences.
    \item \emph{Stochastic Dominance (SD) proportionality}: an allocation satisfies \emph{SD proportionality} if for each agent $i$ and $1 \leq k \leq m$, agent $i$ is allocated at least $\lceil \frac{k}{n} \rceil$ of her top $k$ items.
\end{itemize}

%It was shown in \citet{aziz2015fair} that (1) possible proportionality and weak SD proportionality are equivalent, and
%(2) necessary proportionality and SD proportionality are equivalent. Hence in the following we will only consider two fairness notions: weak SD proportionality and SD proportionality.

The above definitions of weak SD proportionality and SD proportionality are the simplifications of that in \citet{aziz2015fair} when only considering strict preferences.
This is when comparing a uniform allocation with another allocation of an agent using the original SD preference definition in \citet{aziz2015fair}, it reduces to the comparison between $\frac{k}{n}$ and the number of items allocated to this agent in her top $k$ favorites for every $1\leq k\leq m$ under strict preferences.
% when the preferences are strict.

% \begin{example}
\paragraph{Example 1 (continued).}
    For our example above, when considering weak SD proportionality, one certainly fair allocation is to assign items $b,c,d$ to agent $1$ and item $a$ to agent 2. However, when considering SD proportionality, this allocation has probability $0$ to be fair for agent 2.
    The allocation that has the highest probability to be SD proportional is to assign $b,c$ to agent 1 and $a,d$ to agent 2, with fair probability $\frac{1}{4}\cdot \frac{2}{3}=\frac{1}{6}$.

\section{Weak SD Proportionality}

\newcommand{\sta}{\mathsf{sta}}
\newcommand{\num}{\mathsf{num}}
\newcommand{\tot}{\mathsf{tot}}
\newcommand{\dis}{\mathsf{dis}}
\newcommand{\id}{\mathsf{id}}
%\newcommand{\max}{\mathsf{max}}
\newcommand{\limt}{\mathsf{lim}}
\newcommand{\PrevP}{\mathsf{PrevP}}

In this section, we consider the weak SD proportionality.
First we show that given an allocation, one can efficiently compute the probability that this allocation is weak SD proportional.

\begin{theorem}\label{thm:wsdp_fp}
    \FairProb with regard to weak SD proportionality can be solved in polynomial time.
\end{theorem}

\begin{proof}

  Because the uncertainty in each agent's preference is independent, it suffices to show that the probability that the fairness condition is met for each agent $i\in N$ can be computed in polynomial time.
    In the following, we use dynamic programming to calculate this probability.

    For one specific agent $i\in N$, there are $K:=k_i$ equivalent classes and the $j$-th equivalent class has $s_j:=|S_{i,j}|$ items. Firstly, we calculate the number of items owned by $i$ in the $j$-th equivalent class of $i$ and we denote it by $r_j\leq s_j$.

The key to this dynamic programming algorithm is to identify the subproblem structure.
% Note that when calculating fair probability, we care only about the number of items owned by agent $i$ among her top $s$ items for each integer $s\in[m]$, but not the specific ranking of any single item. Thus, w
We use $P_{\num,\tot,\dis}$ to represent the probability that there are $\tot$ items owned by agent $i$ arranged in the top $\num$ items with a fair verification parameter $\dis$ defined as follows:
$$ \dis=\left\{
\begin{aligned}
& 0, \textrm{ if it's tranferred from the state with } \dis'=0 \\
& \max\left\{0,\left\lfloor \frac{\num}{n}+1 \right\rfloor - \tot\right\}, \textrm{ otherwise} \\
\end{aligned}
\right.
$$

Intuitively, $\dis$ shows the distance to weak SD proportionality and once it reaches $0$, it will keep at $0$.

\newcommand{\pluseq}{\mathrel{+}=}

\begin{algorithm}[ht!]
\caption{\FairProb Algorithm}
\label{alg:wsdp_fp}
\begin{algorithmic}[1]
\REQUIRE {\quad \\ $m$: number of items\\ $n$: number of agents \\ $K$: number of equivalent classes of agent $i$ \\ $s_{1,\ldots,K}$: number of items in each equivalent classes\\ $r_{1,\ldots,K}$: number of items owned by agent $i$ in each equivalent classes}
\STATE $P_{\num,\tot,\dis}\leftarrow 0 \quad \forall 0\leq \num,\tot \leq m,0\leq \dis \leq \lfloor \frac{m}{n}+1 \rfloor$ \label{init_begin}
\STATE $P_{0,0,1}\leftarrow 1$ \label{init_end}
\FOR {$\num\leftarrow 0$ to $m-1$} \label{trans_begin}
\FOR {$\tot\leftarrow 0$ to $\num$}
\FOR {$\dis\leftarrow 0$ to $\lfloor \frac{m}{n}+1 \rfloor$}
\IF {$P_{\num,\tot,\dis}\neq 0$}
\STATE Let $\sta$ be the minimum integer such that \\ $\sum_{j\in[\sta]} s_j\geq \num+1$. \label{tem_begin}
\STATE $\PrevP\leftarrow P_{\num,\tot,\dis}$
\STATE $p\leftarrow \frac{\sum_{j\in[sta]} r_j-\tot}{\sum_{j\in[sta]} s_j-\num}$ \label{tem_end}
\IF {$\dis=0$}
\STATE $P_{\num+1,\tot+1,\dis}\pluseq \PrevP\cdot p$ \label{tr1_begin}
\STATE $P_{\num+1,\tot,\dis}\pluseq \PrevP\cdot (1-p)$ \label{tr1_end}
\ELSE
\STATE Let $\id$ be $1$ if $\num+1$ is a multiple of $n$ and \\ $0$ otherwise. \label{tr2_begin}
\STATE $P_{\num+1,\tot+1,\max\{0,\dis+\id-1\}}\pluseq \PrevP\cdot p$ \label{tr2_mid}
\STATE $P_{\num+1,\tot,\dis+\id}\pluseq \PrevP\cdot (1-p)$ \label{tr2_end}
\ENDIF
\ENDIF
\ENDFOR
\ENDFOR
\ENDFOR \label{trans_end}
\RETURN $P_{m,\sum_{j\in[K]}r_{j},0}$ \label{ret}
\end{algorithmic}
\end{algorithm}

The complete algorithm is shown in Algorithm \ref{alg:wsdp_fp}.
% First, we initialize the state array in Steps \ref{init_begin}-\ref{init_end} by only setting the probability of the start state as $1$.
The key steps in this algorithm are the state transfers in Steps \ref{trans_begin}-\ref{trans_end}. We let $\sta$ represent the equivalent class that the $(\num+1)$-ranked item belongs to, and let $p$ represent the probability of the item with ranking $(\num+1)$ owned by $i$ under the present state in Steps \ref{tem_begin}-\ref{tem_end}.

We consider the specific transfers in two cases. Steps \ref{tr1_begin}-\ref{tr1_end} solve the first case with $\dis=0$ where we have already reached fairness and the remaining is to arrange the order of the rest items.
Steps \ref{tr2_begin}-\ref{tr2_end} solve the second case with $\dis>0$ where $\dis$ has never met $0$ before and we need to update it based on the definition. In both these two cases, we need to update the state based on the situation of whether the next item is owned by agent $i$.
Specifically, when $\dis=0$, if the next item is owned by agent $i$, there are $\tot+1$ items owned by $i$ arranged in the top $\num+1$ items, so we transfer the state to $P_{\num+1,\tot+1,\dis}$ in Step \ref{tr1_begin}, otherwise only $\tot$ items in $i$'s bundle are arranged in the top $\num+1$ items, which corresponds to the state $P_{\num+1,\tot,\dis}$ in Step \ref{tr1_end}.
For the case of $\dis>0$, on top of the change of $\tot$, we also use $\id$ to record the change of the term $\lfloor \frac{\num}{n}+1 \rfloor$ in the above definition of $\dis$ in Step \ref{tr2_begin}.
Then, we transfer the state to $P_{\num+1,\tot+1,\max\{0,\dis+\id-1\}}$ in Step \ref{tr2_mid} if the next item is owned by $i$, or $P_{\num+1,\tot,\dis+\id}$ in Step \ref{tr2_end} otherwise.

Finally, Step \ref{ret} returns the probability that the fairness condition is met for agent $i$ with her all owned items. 
\end{proof}
We further show that \ExFairNonZero can also be solved in polynomial time based on Theorem 7 in~\citet{aziz2015fair}. We defer the detailed proof to the online supplement.
\begin{theorem}\label{thm:wsdp_epfa2}
    \ExFairNonZero with regard to weak SD proportionality can be solved in polynomial time.
\end{theorem}

% \begin{proof}
%
% \citet{aziz2015fair} showed that when agents have strict and deterministic preferences,  a weak SD proportional allocation exists if and only if (1) $m=n$ and no item is least preferred by all agents, or (2) $m>n$. Furthermore, when such allocation exists, it can also be found in polynomial time.
%
% This result allows us to derive a simple algorithm for \ExFairNonZero. First, when $m>n$, we can simply find an arbitrary set of linear extensions and compute a corresponding weak SD proportional allocation.
% When $m=n$, we need to find a set of linear extensions in which no item is least preferred by all agents, then compute a weak SD proportional allocation with regard to this preference profile. To find such a preference profile, we can construct a bipartite graph between the agents and the items, such that an edge exists if and only if the item is not least preferred by the agent in some preference profiles.
% %For finding such a preference profile, we can use a matching algorithm to solve this. We build a bipartite graph $G=(A\cup B,E)$, where $A$ contains $n$ vertices representing each agent and $B$ contains $n$ vertices representing each item. In edge set $E$, there exists an edge between $a\in A$ and $b\in B$ if and only if the item corresponding to $b$ is not the least preferred for agent corresponding to $a$ in some preference profiles.
% If there exists a perfect matching in this bipartite graph, this perfect matching corresponds to an allocation that is weak SD proportional with non-zero probability. If the graph does not have a perfect matching, because each agent has at least $n-1$ edges, by Hall's marriage theorem~\citep{hall2009representatives}, there must exist one item which is least preferred by all agents in all preference profiles. Thus, there is no allocation with non-zero fair probability.
% \end{proof}

\newcommand{\SAT}{\textsc{(2,2)-E3-SAT}\xspace}

Next we turn to \ExFairOne problem. Unlike \ExFairNonZero, we show that it is NP-hard to determine whether there exists an allocation that is weak SD proportional with probability one.
To prove this hardness result, we reduce from a known NP-hard problem denote as \SAT~\citep{berman2004approximation}.

\medskip

\vbox{
\noindent\rule{3.3in}{0.6pt}

\noindent \textbf{\SAT:} 
Given a boolean formula in conjunctive normal form in which each clause has three literals and each variable occurs exactly twice positive and twice negative, decide whether this boolean formula is satisfiable.\\
\noindent\rule{3.3in}{0.6pt}
}

\medskip

\begin{theorem}\label{thm:wsdp_ecfa2}
    \ExFairOne and \HighProb with regard to weak SD proportionality are NP-hard.
\end{theorem}

\begin{proof}
    % We only prove the NP-hardness for \ExFairOne, which implies NP-hardness for \HighProb.
    We reduce from \SAT to \ExFairOne, which can also imply NP-hardness for \HighProb.
    Considering a \SAT instance $F$ with $s$ variables $X=\{x_1,\ldots,x_s\}$ and $t$ clauses which satisfies $4s=3t$. Based on $F$ we construct a problem instance of \ExFairOne with $6s$ agents and $12s$ items.

    The agents are divided into two sets. The first is a set of $2s$ agents $A=\{A_1,\ldots,A_{2s}\}$ where $A_{2k-1}$ corresponds to the true valuation of $x_k$ and $A_{2k}$ corresponds to the false valuation of $x_k$ for each $k\in[s]$. The second set is the set of the remaining $4s$ dummy agents $A'=\{A'_1,\ldots,A'_{4s}\}$.

    The $12s$ items are divided into five sets as follows:
    \begin{itemize}
        \item A set of $t$ items $C=\{C_1,\ldots,C_t\}$, where $C_i$ corresponds to the $i$-th clause in \SAT;
        \item A set of $t/2$ items $T=\{T_1,\ldots,T_{t/2}\}$, given to the agents corresponding to the correct value of variables together with the items in $C$;
        \item A set of $s$ items $S=\{S_1,\ldots,S_{s}\}$, compensated for the agents representing the wrong value of variables;
        \item A set of $6s$ dummy items $B=\{B_1,\ldots,B_{6s}\}$, where each $2$ items are bound to $3s$ agents in $A'$;
        \item A set of $3s$ dummy items $Q=\{Q_1,\ldots,Q_{3s}\}$, where each $3$ items are bound to the remaining $s$ agents in $A'$.
    \end{itemize}

    Next, we construct the preference lists for agents. For each agent $A_i \in A$, we denote $R_i$ as a set of items such that: for each $k\in[s]$, $R_{2k-1}$ and $R_{2k}$ consist of the two items in $C$ corresponding to the clauses containing the positive $x_k$ and the negative $x_k$ respectively. The preference of each agent $A_i$ in $A$ is: $S_{\lceil i/2 \rceil}\succ (R_i,T,B) \succ (\textrm{others})$. The preference of each dummy agent $A'_i$ in $A'$ is: $(B)\succ(\textrm{others})$.

    An example of this construction is shown below.

    \medskip

    \vbox{
    \noindent\rule{3.3in}{0.6pt}

    \paragraph{Example 2.}
    Consider a simple \SAT problem instance with $s=3$ variables and $t=4$ clauses:

    \begin{enumerate*}[series=MyList]
    \item $x_1\vee x_2\vee\neg x_3$ \qquad
    \item $x_1\vee\neg x_2\vee x_3$
    \end{enumerate*}

    \begin{enumerate*}[resume=MyList]
        \item $\neg x_1\vee x_2 \vee x_3$ \qquad
        \item $\neg x_1\vee \neg x_2 \vee \neg x_3$
    \end{enumerate*}

    The corresponding instance of \ExFairOne has $18$ agents and $36$ items. The preference lists are as follows:
    \begin{itemize}
    \item Agent $1$: $S_1\succ (C_1,C_2,T_1,T_2,B_1,\ldots,B_{18})\succ (S_2,S_3,C_3,C_4,Q_1,\ldots,Q_9)$
    \item Agent $2$: $S_1\succ (C_3,C_4,T_1,T_2,B_1,\ldots,B_{18})\succ (S_2,S_3,C_1,C_2,Q_1,\ldots,Q_9)$
    \item Agent $3$: $S_2\succ (C_1,C_3,T_1,T_2,B_1,\ldots,B_{18})\succ (S_1,S_3,C_2,C_4,Q_1,\ldots,Q_9)$
    \item Agent $4$: $S_2\succ (C_2,C_4,T_1,T_2,B_1,\ldots,B_{18})\succ (S_1,S_3,C_1,C_3,Q_1,\ldots,Q_9)$
    \item Agent $5$: $S_3\succ (C_2,C_3,T_1,T_2,B_1,\ldots,B_{18})\succ (S_1,S_2,C_1,C_4,Q_1,\ldots,Q_9)$
    \item Agent $6$: $S_3\succ (C_1,C_4,T_1,T_2,B_1,\ldots,B_{18})\succ (S_1,S_2,C_2,C_3,Q_1,\ldots,Q_9)$
    \item Agent $7$-$18$: $(B_1,\ldots,B_{18})\succ (S_1,S_2,S_3,C_1,\ldots,\\C_4,T_1,T_2,Q_1,\ldots,Q_9)$
    \end{itemize}
    \noindent\rule{3.3in}{0.6pt}
    }

    \medskip

    If the \SAT instance has a satisfying assignment, we can construct an allocation as follows:
    \begin{itemize}
        \item If variable $x_i$ is $\mathrm{TRUE}$, we assign $S_i$ to $A_{2i}$, otherwise we assign $S_i$ to $A_{2i-1}$;
        \item For the $j$-th clause, suppose the first true term in it is about $x_i$. Then, if this term is positive $x_i$, we assign $C_j$ to $A_{2i-1}$, otherwise we assign $C_j$ to $A_{2i}$.
        \item For agents in $A$ who do not receive any $S_i$, we assign items in $T$ to them so that these agents can each receive exactly two items. We know this can be satisfied because $2s=t+t/2$.
        \item Finally, we assign two items in $B$ to each of the first $3s$ agents in $A'$ and assign three items in $Q$ to each of the remaining $s$ agents in $A'$ arbitrarily.
    \end{itemize}

    For the agents in $A$ who get an item in $S$, their fairness conditions are met because they get their unique most preferred item respectively. Each of the remaining agents in $A$ gets exactly two items that are not least preferred by them, so their fair conditions are also met. Finally, agents in $A'$ also meet the fair conditions because either they receive two items that they do not prefer the least, or they receive three items. Thus, this allocation must satisfy weak SD proportionality.

    On the other hand, assume there is an allocation that is weak SD proportional with probability one, we can construct a satisfying assignment for the \SAT instance. First, the agents in $A$ who do not receive their most preferred item must get at least two items to meet the fair condition. Because there are at most $s$ agents that can receive items in $S$, at least $s$ agents in $A$ need at least two items. Next, for the agents in $A'$, they can meet the fairness condition if and only if they receive either two items in $B$ or three items. Because of the limit of the number of items in $B$, at most $3s$ agents in $B$ can meet the fair condition with only two items.

    We can consider the most optimistic situation: $s$ agents in $A$ each get their most preferred item in $S$ and the remaining $s$ agents in $A$ get exactly two items in their respective second equivalent class but not in $B$; $3s$ agents in $A'$ each get exactly two items in $B$ while the remaining $s$ agents in $A'$ each get three items. The number of items needed in total is $12s$, which means that this situation is necessary.

    Therefore, for any $k\in[s]$, exactly one agent between $A_{2k-1}$ and $A_{2k}$ gets the corresponding $S_k$ while the other one needs to get two items from $C\cup T$, whose size is $t/2+t=2s$. This means each item in $C$ must be chosen by the agents in $A$, and this will lead to a satisfying assignment for \SAT with such value scheme: for each pair $A_{2k-1}$ and $A_{2k}$ with $k\in[s]$, we set $x_k=\mathsf{FALSE}$ if $A_{2k-1}$ gets $S_k$ otherwise we set $x_k=\mathsf{TRUE}$.

    \medskip

    \vbox{
    \noindent\rule{3.3in}{0.6pt}

    \paragraph{Example 2 (continued).}
    The above mentioned \SAT instance is satisfiable by setting $x_1=\mathrm{TRUE},x_2=\mathrm{TRUE},x_3=\mathrm{FALSE}$. We can get the corresponding allocation for the \ExFairOne instance:
    \begin{itemize}
    \item The agent representing the wrong valuation of each variable takes the corresponding item in $S$: agent $2,4$ and $5$ takes their respective $S_1,S_2,S_3$.
    \item Each item representing the clause is taken by the agent representing the first true term: agent $1$ takes $C_1,C_2$, agent $3$ takes $C_3$, and agent $6$ takes $C_4$, and $T_1,T_2$ are given to agent $3$ and $6$ as a compensation.
    \item Each two of $B_{1,\ldots,18}$ are assigned to agent $7-15$, and each three of $Q_{1,\ldots,9}$ are assigned to agent $16-18$.
    \end{itemize}
    One can check that this is a certainly fair allocation in our \ExFairOne instance.

    \noindent\rule{3.3in}{0.6pt}
    }
\end{proof}


Next we present several positive results and short discussions on solving \ExFairOne and \HighProb for special cases.

\begin{theorem}\label{thm:wsdp_ecfas}
    \ExFairOne with regard to weak SD proportionality can be solved in polynomial time when all agents have identical preferences.
\end{theorem}

When all agents have identical preferences, we can derive an optimal greedy algorithm that assigns items to agents such that each agent receives consecutive items in a preference order from the most to the least preferred items. This demonstrates the polynomial-time solvability of the \ExFairOne. In this analysis, the assumption of identical preferences is critical since it allows us to sort all items before the allocation, which is a crucial step in the follow-up analysis.
% In practice, we can also use this algorithm as a heuristic when agents have different but similar preferences.}

% \begin{proof}
%
% 	Firstly, we simplify some notions when agents have identical preferences: we use $K$ to represent the number of equivalent classes and use $S_j$ to represent the $j$-th equivalent class. Then we re-number all items with indices $1$ to $n$ such that $S_1=\{1,\ldots,|S_1|\}$ and $S_j=\{\sum_{k=1}^{j-1} |S_k|+1,\ldots,\sum_{k=1}^{j} |S_k|\}$ for each $1<j\leq K$. This means for all agents, smaller-indexed items are always more preferred.
%
%    We consider the following greedy algorithm. For each agent from 1 to $n$, we consider the remaining items in increasing order of indices, and allocate them to this agent one by one, until the current allocation met the fairness condition for this agent with probability 1. We repeat this process until all items are fully allocated or all agents have received their desired bundles of items.
%
%     In the following, we show that if a certainly fair allocation $M$ exists in a problem instance, the above greedy algorithm can always return such a certainly fair allocation.%we can always convert it to another certainly fair allocation output by the above greedy algorithm.
%
%
%
% 	Next, we perform a three-step transformation on the given certainly fair allocation $M$:
%     \begin{itemize}
%     \item For each agent $i$, if removing the item with largest index in her bundle can still keep her fairness condition met, we will remove that item from $i$'s bundle. Repeat this process until no items can be removed anymore. After this step, we denote $\sta_i$ as the equivalent class the worst item in $i$'s bundle belongs to. Then, for any agent $i$, she could not have her fairness condition met after throwing the present worst item and all owned items are always least preferred in their respective equivalent classes in the worst case, so there must exist $\sum_{j=1}^{\sta_i-1} |S_j|<k_i\leq \sum_{j=1}^{\sta_{i}} |S_j|$ such that agent $i$ is allocated at least $\lfloor \frac{k_i}{n}+1 \rfloor$ of her top $k_i$ items in the worst case mentioned above.
%     \item Next, we find any agent who has item $o$ that has a larger index than some thrown away item $o'$, and we replace $o$ with $o'$. Again repeat this process until no such changes can be made. We know $M$ is still certainly fair. After this step, the present allocation must contain exactly all the items in $[m']$ for some $m' \leq m$.
%     \item Finally, if there exists agent $i$ and $j$ such that the worst item in $i$'s bundle has a larger index than the worst items in $j$'s bundle, and agent $i$ also has an item $o_i$ with a smaller index than some item $o_j$ belonging to agent $j$, we will be able to swap $o_i$ and $o_j$ while still keeping the fairness conditions for both agents. This obviously holds for agent $j$. For agent $i$, this claim is true because $o_j$ is still not worse than the worst item in $i$'s bundle and it still holds that agent $i$ is allocated at least $\lfloor \frac{k_i}{n}+1 \rfloor$ of her top $k_i$ items in the worst case for that $k_i$. Repeat this until no more exchanges can be made. After this step, we know the allocation must still be certainly fair and it is a consecutive partition of $[m']$ for some $m' \leq m$.
%     \end{itemize}
%
%
%     Finally, it is easy to see if there exists a consecutive partition that is certainly fair, the allocation computed by our greedy algorithm must be also certainly fair.
% \end{proof}

\begin{theorem}\label{thm:wsdp_awhfpfpt}
    \ExFairOne and \HighProb with regard to weak SD proportionality can be solved in polynomial time when the number of agents is constant.
\end{theorem}

When the number of agents $n$ is a constant, we can derive the following exact algorithm. First, we enumerate the number of items assigned to each agent from each equivalent class. Next, we use a perfect matching algorithm to find a corresponding allocation scheme and apply \FairProb to calculate the fair probability. The total number of enumerations is in the order of $O(n^{4n^2+n+1})$ which is a constant. However, this is no longer true if $n$ is a super-constant. Therefore, the constant assumption is an important assumption to get a polynomial-time solvable algorithm.

% \begin{proof}
%
% Let $m=qn+r$, where $q,r$ are integers and $0\leq r<n$.
%
% First, we observe that any agent who gets $q+1$ items is always weak SD proportional with probability one. Thus we can assume that no agent gets more than $q+1$ items in the allocation with the highest fair probability. This also implies that every agent gets at least $q_m = q-(n-1-r)$ items, because otherwise the total number of allocated items will be less than $q-(n-1-r)+(n-1)(q+1)=qn+r=m$.
%
% If there exists some agent $i$ such that $|S_{i,1}|<n\cdot q_m$, we can choose $\min\{|S_{i,1}|, q_m\}$ items from $S_{i,1}$ to be allocated to agent $i$, which guarantees the fair condition for agent $i$ to be met with probability one. Next, we assign all other agents $q+1$ arbitrary items each and give the remaining items back to $i$. It is easy to check that this allocation is weak SD proportional with probability one.
%
% Now we consider the case where $|S_{i,1}|\geq n\cdot q_m$ holds for every agent $i \in N$. This means that the total number of items not in the first equivalent class for any agent is no more than $n(n-1-r)+r$.
%
% For each agent $i$, if there exists an integer $1\leq j <|k_i|$, such that $1+\sum_{t=1}^{j-1} |S_{i,t}|\geq (q'-1)n$ and  $\sum_{t=1}^{j+1} |S_{i,t}|<q'n$ for some $q' \leq q+1$, then the items in the $j$-th and $(j+1)$-th equivalent classes can be merged into one equivalent class without affecting the fair probability of any allocation, because all items in these two equivalent classes will always have the ranking in the range between $(q'-1)n$ and $q'n-1$. We don't really care about the specific ranking in this range because we can simplify the definition of weak SD proportionality to only consider whether there exists $k\in\{n-1,2n-1,\ldots,qn-1,m\}$
% such that agent $i$ is allocated at least $\lfloor \frac{k}{n}+1 \rfloor$ of her top $k$ items.
% We repeatedly merge such adjacent equivalent classes until none can be found.
% By the end of this procedure, the total number of equivalent classes in each agent's preference list is no more than $1+2\cdot (n-1-r+1)=2(n-r)+1$.
%
% Next, we enumerate the number of items assigned to each agent $i$ from each equivalent class.
% More specifically, for each agent $i$, we first enumerate the total number of items in her bundle and then the number $C_{i,j}$ of items in each $S_{i,j}$ assigned to agent $i$. For each set of numbers $\{C_{i,j}\}$, we use the following perfect matching algorithm to find candidate allocations.
% \begin{itemize}
% \item We construct the bipartite graph $G=(A\cup B,E)$ where $A$ has  $C_{i,j}$ duplicate vertices representing the positions for items in $S_{i,j}$ for each agent $i\in[n]$ and each equivalent class $j\in[k_i]$, and $B$ contains $m$ vertices each representing an item. For each duplicate vertex for $S_{i,j}$ in $A$ and each vertex in $B$ corresponding to the item in $S_{i,j}$, there is an edge between them in $E$;
% \item If there exists a perfect matching between $A$ and $B$ (which also implies $|A|=|B|$), we pick the allocation where each item whose corresponding vertex is matched with one duplicate vertex for one $S_{i,j}$ is assigned to agent $i$ and it meets our requirements.
% \end{itemize}
% If such allocation exists, its fair probability can be computed using the algorithm designed for \FairProb. Finally, we return the allocation with the highest fair probability.
%
% Finally we analyze the time complexity of the above algorithm. The first step takes $O(nm)$ to enumerate each agent and each item. Merging equivalent classes also takes $O(nm)$ time. Next, for the enumeration step,
% because each number $C_{i,j}\leq n(n-1-r)+r$ when $j>1$ and the total number of items in any bundle is between $q-(n-1-r)$ and $q+1$, the total number of possibilities is $O((n(n-1-r)+r+1)^{2(n-r)\cdot n}\cdot (n-1-r+1+1)^n)=O(n^{4n^2+n+1})$. Finally, deciding the existence of an allocation and calculating its fair probability takes $O(m^3)$ time. Thus, the overall time complexity of this algorithm is $O(n^{4n^2+n+1}\cdot m^3)$.
% \end{proof}

\section{SD Proportionality}
\newcommand{\XC}{{\textsc{X3C}\xspace}}

In this section, we turn our focus to SD proportionality. This is a stronger fairness requirement than weak SD proportionality.
Similar to the weak SD proportionality case, we show that with regard to SD proportionality, \FairProb and \ExFairNonZero can be solved in polynomial time, while \ExFairOne and \HighProb are both NP-hard. The techniques we use to prove these results are similar in spirit to those for weak SD proportionality. However, due to the difference between these two fairness concepts, adjustments need to be made to the proofs to make them work in the SD proportionality setting. For example, to prove the NP-hardness for \ExFairOne and \HighProb with regard to SD proportionality, we need to reduce from another NP-hard problem known as \XC \, from~\citet{johnson1979computers}.

Below we list all the results in this section. The details of all proofs, except the proof of Theorem~\ref{thm:sdp_ecfa4}, are deferred to the supplementary material due to page limits.

%\xiaohui{move all proofs in this section to supplement material, except the last theorem}

\begin{theorem}\label{thm:sdp_fp}
   \FairProb with regard to SD proportionality can be solved in polynomial time.
\end{theorem}

\begin{theorem}\label{thm:sdp_epfa2}
    \ExFairNonZero with regard to SD proportionality can be solved in polynomial time.
\end{theorem}

\begin{theorem}\label{thm:sdp_ecfa2}
     \ExFairOne and \HighProb with regard to SD proportionality are NP-hard.
\end{theorem}

In the proof of Theorem \ref{thm:sdp_ecfa2}, we can see even if the number of equivalent classes of each agent is $6$, \ExFairOne is still NP-hard.

\begin{theorem}\label{thm:sdp_ecfa4}
    \ExFairOne with regard to SD proportionality can be solved in polynomial time if the number of equivalent classes of each agent is at most $4$.
\end{theorem}

\begin{proof}
    SD proportionality with probability one is a very demanding condition. We first list some properties that such an allocation must satisfy.
    First, a direct corollary from \citet{aziz2015fair} shows that such an allocation may exist only when $m = qn$ for some integer $q$ and each agent gets exactly $q$ items.

    Second, each agent must get all items in her first equivalent class to meet the fair condition with $k=1$. Each agent also cannot get any items in her last equivalent class. This is because, suppose agent $i$ gets at least one item in her last equivalent class, we can make this item her least favorite item, so we need to use the other $q-1$ items to satisfy all fair conditions with $k\leq qn-1$, which is impossible when $n>1$.
    These two conditions also imply that the number of equivalent classes for each agent must be greater than $1$ and the number of items in the first equivalent class must be no more than $q$ for a certainly fair allocation to exist.

    We will utilize the above characterizations to determine the existence of a certainly SD proportional allocation.
    More specifically, we will reduce the \ExFairOne problem to a max-flow problem in a flow network $G$. The construction is as follows. Let the flow network $G = (V, E)$ with a capacity function $c: E \mapsto \RR^+$.
    $V$ consists of a source vertex $s$, a target vertex $t$, a vertex set $A$ defined later and a vertex set $B$ of $m$ vertices representing the $m$ items. For each vertex $j$ in $B$, we create an edge $(j, t)$ with capacity $c=1$.
    Next, for each agent $i$, we construct its vertices in $A$ depending on the number $k_i$ of its equivalent classes.
    \begin{itemize}
    \item $k_i=2$: Because we cannot give agent $i$ any items in her last equivalent class and each agent must get all items in her first equivalent class, we must have $|S_{i,1}|=q$, otherwise there is no certainly fair allocation. Thus, we create a vertex $i$ in $A$ representing agent $i$, and construct edges $(i, j)$  with capacity $c=1$ for each vertex $j \in S_{i,1}$ in $B$. We also construct an edge pointing from the source $s$ to $i$ with capacity $c=q$.
    \item $k_i=3$: Similar to the case $k_i=2$, agent $i$ must get all items in $S_{i,1}$ and the remaining $q-|S_{i,1}|$ items from $S_{i,2}$. We can use the algorithm for \FairProb to check whether such an allocation can meet agent $i$'s fairness condition with probability one. If not, it means there does not exist a certainly fair allocation. Otherwise, we create two vertices $i_1, i_2$ in $A$ for agent $i$.
    \begin{itemize}
        \item The first vertex $i_1$ has an edge $(s, i_1)$ with $c=|S_{i,1}|$, and edges $(i_1, j)$ with $c=1$ for each vertex $j \in S_{i,1}$ in $B$;
        \item The second vertex $i_2$ has an edge $(s, i_2)$ with $c=q-|S_{i,1}|$, and edges $(i_2, j)$ with $c=1$ for each vertex $j \in S_{i,2}$ in $B$.
    \end{itemize}
    \item $k_i=4$: This is the most complicated case. We assume that the numbers of items owned by agent $i$ in the first three equivalence classes are $x,y,z$. It must satisfies $x=|S_{i,1}|$ and $x+y+z=q$. Once the value of $x$ is fixed, we observe that the probability that agent $i$ meets the fair condition increases with $y$. So we can find the minimum $y'\leq \min\{q-x,|S_{i,2}|\}$ such that $i$ can meet her fair condition with probability one. If there exists no such $y'$, there is no certainly fair allocation for this instance. Otherwise, we know for all eligible $y\geq y'$, agent $i$ can always meet the fair condition with probability $1$. Following this idea, we create three vertices $i_1, i_2, i_3$ in $A$ for $i$:
        \begin{itemize}
        \item the first vertex $i_1$ has an edge $(s, i_1)$ with $c=x$, and edges $(i_1, j)$ with $c=1$ for each vertex $j \in S_{i,1}$ in $B$;
        \item the second vertex $i_2$ has an edge $(s, i_2)$ with $c=y'$, and edges $(i_2, j)$ with $c=1$ for each vertex $j \in S_{i,2}$ in $B$;
        \item the third vertex $i_3$ has an edge $(s, i_3)$ with $c=q-x-y'$, and edges $(i_3, j)$ with $c=1$ for each vertex $j \in S_{i,2}\cup S_{i,3}$ in $B$. The intuition for this step is to allow the allocation to give more items to agent $i$ in $S_{i,2}$.
        \end{itemize}
    \end{itemize}

With this construction, one can check that if there exists a maximum flow with value $m=qn$, the corresponding allocation must be SD proportional with probability one, because it meets all fair conditions for each agent according to our analysis.
% as follows: for each edge from a vertex $a\in A$ to a vertex $b\in B$ whose flow is equal to $1$, we assign the item corresponding to $b$ to the agent corresponding to $a$. We know this is certainly fair because this met all fair conditions for each agent in our previous analysis.}
\end{proof}

\noindent \textbf{Remark:} The algorithm can not be directly generalized to the case when some agent $i$ has more than 4 equivalent classes. To see it, note that if we continue to use this approach and assume that the number of items owned by agent $i$ in her top four equivalent classes are $x,y,z,w$, we still have $x=|S_{i,1}|$ and $x+y+z+w=q$. But it is no longer true that the fair probability is monotone increasing with both $y$ and $z$. This is because the fair probability may decrease if $z$ decreases even when $y$ increases.

\section{Experiments}
\newcommand{\avg}{\mathsf{avg}}
\newcommand{\baseline}{\textsc{Baseline}\xspace}
\newcommand{\ls}{\textsc{LocalSearch}\xspace}
\newcommand{\matching}{\textsc{Matching}\xspace}
\newcommand{\greedy}{\textsc{Greedy}\xspace}

In this section, we focus on \HighProb with respect to weak SD proportionality given the importance of finding allocations with a high fair probability. Since we have shown this problem is NP-hard, % the hardness result for this problem, 
we will only present several heuristic algorithms for it. The performance and computational efficiency are evaluated on both synthetic and real datasets.

\subsection{Algorithms}

We design and evaluate four algorithms for \HighProb. The details and parameters used in each algorithm can be found in the supplementary material.

\begin{enumerate}
\item \textbf{\baseline(B)}: This is a baseline algorithm that assigns each item to a random agent to get a random allocation.
% We repeat this process $B$ times to get $B$ random allocations and choose the one with the largest fair probability. We set $B=4m$ in the experiment. We also tested our algorithm with $B$ increased to $8m$, and did not observe any noticeable improvement on the algorithm's performance.

\item \textbf{\ls(LS)}: This is a local search algorithm that repeatedly move one item from one agent to another until the allocation reaches a local optima.
% Two allocations are called neighbors if one allocation can be derived from the other  by moving one item from some agent to another agent. In this Local Search algorithm, we start from a random allocation and iteratively move to a neighbor allocation that has a higher fair probability, until a locally optimal allocation is reached. We repeat the above process $L$ times, each time with a new random initial allocation, and choose the final allocation with the highest fair probability. We set $L=n$ in the experiment. We also tested our algorithm with $L$ increased to $2n$, and did not observe any noticeable improvement on the performance.

\item \textbf{\matching(M)}: This is a multi-round matching algorithm that matches each agent to an item in each round. In particular, the weight of each arc linking an agent to an item is based on a function of the item's possible rankings in the agent's preference list. We apply multi-round maximum weight matching algorithms to assign the items to each agent.  
%assigns each agent a weight for getting each item from a function over the possible rankings of the item and uses multi-round maximum weight matching to assign the items to each agent. \zz{zz: not clear to me}
% \todo[inline]{whether need to say more here?}
%
% Since in a weak SD proportional allocation, every agent needs to receive $\lfloor \frac{r}{n} \rfloor +1$ items with ranking not worse than $r$ for some $r$. We set the value of an agent getting an item with ranking $r$ as $\frac{1}{\lfloor \frac{r}{n} \rfloor +1}$.
% For each agent $i$ and item $o$, let $\avg(i,o)$ be the average value of $i$ getting $o$.
%
% This algorithm runs for $\frac{m}{n}+1$ rounds and assigns at most one item to each agent each round.
% In round $k$, let $R_i$ be the total value that agent $i$ has received in previous rounds, then for each item $o$, we set the value of agent $i$ getting item $o$ in this round as $(1-R_i)\cdot \avg(i,o)$.
% In addition, we remove all edges whose values are less than a certain threshold $L$. Then we find a maximum weight matching between agents and items and assign the item to the matched agent. Finally, we update $R_i$ for each agent and remove all agents who receive a total value larger than another threshold $U$ from consideration in future rounds.
% After finishing $\frac{m}{n}+1$ rounds, we allocate the remaining items to the agents with less than $\frac{m}{n}+1$ items arbitrarily.
%
% In our experiment, we enumerate $5$ different lower bound $L$ from $\frac{1}{\lfloor \frac{m}{n} \rfloor +1}$ to $\frac{1}{\lfloor \frac{m}{n} \rfloor +1}+0.1$ equidistant and $11$ different upper bound $U$ from $1$ down to $0.7$ equidistant. We run the algorithm for each pair of $L$ and $U$, and choose the allocation with the largest fair probability among all solutions.
% We also test the algorithm with $L$ higher than $\frac{1}{\lfloor \frac{m}{n} \rfloor +1}+0.1$ or with $U$ lower than $0.7$ and do not observe significant performance improvement.

\item \textbf{\greedy(G)}:
This algorithm first converts \HighProb to a submodular welfare maximization problem and then uses a greedy algorithm from~\cite{lehmann2006combinatorial} to output a 2-approximation solution.

% For each agent $i$ and item $o$, we adopt notion $\avg(i,o)$ from the previous \matching algorithm to be the average value of $i$ getting $o$. Then
% for each agent $i$ and a set $S$ of items, when calculating the $R_i$ in the above \matching algorithm, we can find that it's always equal to $1-\prod_{o\in S}(1-\avg(i,o))$ no matter in what order the items in $S$ are adding to agent $i$'s bundle. Thus, we let $f_i(S)=\min(U,1-\prod_{o\in S}(1-\avg(i,o)))$ denote the value of this agent receiving $S$, where $U$ is a threshold parameter. One can check that $f_i$ is a submodular function, and our question becomes a general submodular welfare maximization problem.
% We then use a greedy algorithm from \citet{lehmann2006combinatorial} which always outputs a $2$-approximation solution for the submodular welfare maximization problem.

 % and under each upper bound $U$, we set the submodular function $f_i(S)=\min(U,1-\prod_{o\in S}(1-\avg(i,o)))$ and use the greedy algorithm to compute the solution.
% In the experiment, we run this algorithm with $11$ different values of $U$ from $1$ down to $0.7$, and choose the allocation with the largest fair probability. We also tested our algorithm with the value of $U$ less than 0.7, and found it did not improve the algorithm's performance.

\end{enumerate}

% \zihao{In the above four algorithms, we set the parameters in the way that all four algorithms can have running times of the same magnitude.}

\subsection{Datasets}
We test the above four algorithms on both synthetic and real datasets.

\begin{enumerate}

\item \textbf{Synthetic dataset}: We enumerate $n$ from $2$ to $20$ and $m$ from $n$ to $5n$. For each $p\in\{0.02,0.03,0.04,0.05,0.06\}$, we create $30$ datasets in the following way: For each agent we create a random permutation of all items. For each pair of adjacent items in the permutation, we separate them into two equivalent classes  
%in her uncertain preference 
with probability $p$.
We choose $p$ to be in this range because when $p$ becomes larger, all the four algorithms can easily find an almost certainly fair assignment and there is no significant difference in their performance.

\item \textbf{Real dataset}: We use the Preflib database from~\citet{mattei2013preflib}, which is an online database of real-world preference profiles to test our algorithms. We select 11 datasets from two categories in this database:
\begin{enumerate}
    \item \emph{Matching Data (MD-00002)}: This category contains bidding preferences of reviewers over a subset of papers at Computer Science conferences. Each preference is an incomplete list with ties. We convert each preference into a complete list with ties by adding the remaining items as the last equivalent class. This category has $3$ datasets corresponding to $3$ different conferences.

    \item \emph{Matching Data (MD-00003)}: This category contains bids of students over a set of projects for student/project allocations at a university. It has $8$ datasets in total, all with complete preferences with ties, with $31$-$51$ students and $56$-$155$ projects.
\end{enumerate}

\end{enumerate}

\subsection{Results and Discussions}

\subsubsection{Synthetic dataset}
We measure the performance of each algorithm by the average fair probability across various tested datasets. Figure \ref{randomper} shows the average fair probability generated by each algorithm for each $n$ from $2$ to $20$. Each average fair probability is taken over multiple datasets with different $m$ and $p$. 
Figure \ref{randomtime} presents the average running time of each algorithm.

\begin{figure}[!ht]
	\begin{tikzpicture}
	\begin{axis}[width=6.7cm, height=5.5cm,legend style={at={(1.01,0.7)},anchor=west,xlabel=Number of Agents,ylabel=Average Fair Probability}]
	   \addplot[color=red,mark=square,mark size=2pt, line width=0.7pt] coordinates {(2,0.633) (3,0.719) (4,0.751) (5,0.753) (6,0.745) (7,0.739) (8,0.727) (9,0.717) (10,0.704) (11,0.695) (12,0.681) (13,0.671) (14,0.657) (15,0.648) (16,0.637) (17,0.625) (18,0.617) (19,0.607) (20,0.598) };
	   \addlegendentry{B}
	   \addplot[color=green,mark=x,mark size=2pt, line width=0.7pt] coordinates {(2,0.619) (3,0.726) (4,0.785) (5,0.816) (6,0.837) (7,0.857) (8,0.870) (9,0.880) (10,0.891) (11,0.899) (12,0.903) (13,0.911) (14,0.915) (15,0.920) (16,0.926) (17,0.929) (18,0.933) (19,0.936) (20,0.941)};
	   \addlegendentry{LS}
	   \addplot[color=blue,mark=triangle,mark size=2pt, line width=0.7pt] coordinates {(2,0.639) (3,0.740) (4,0.795) (5,0.823) (6,0.844) (7,0.865) (8,0.877) (9,0.889) (10,0.899) (11,0.908) (12,0.913) (13,0.920) (14,0.925) (15,0.930) (16,0.936) (17,0.939) (18,0.943) (19,0.946) (20,0.950)};
	   \addlegendentry{M}
	   \addplot[color=black,mark=o,mark size=2pt, line width=0.7pt] coordinates {(2,0.618) (3,0.717) (4,0.774) (5,0.807) (6,0.826) (7,0.848) (8,0.864) (9,0.876) (10,0.887) (11,0.898) (12,0.903) (13,0.911) (14,0.917) (15,0.923) (16,0.929) (17,0.933) (18,0.937) (19,0.941) (20,0.945)};
	   \addlegendentry{G}
	\end{axis}
	\end{tikzpicture}
	\caption{Algorithm performance over synthetic data}
	\label{randomper}
	\end{figure}
	
	\begin{figure}[!ht]
	\begin{tikzpicture}
	\begin{axis}[width=6.7cm, height=5.5cm,legend style={at={(1.01,0.7)},anchor=west,xlabel=Number of Agents,ylabel=Average Running Time(ms)} ]
	   \addplot[color=red,mark=square,mark size=2pt, line width=0.7pt] coordinates {(2,0.970) (3,2.553) (4,5.215) (5,9.315) (6,15.313) (7,22.554) (8,29.982) (9,41.838) (10,54.525) (11,66.924) (12,84.813) (13,103.620) (14,126.287) (15,141.612) (16,157.010) (17,185.136) (18,218.655) (19,230.527) (20,308.214) };
	   \addlegendentry{B}
	   \addplot[color=green,mark=x,mark size=2pt, line width=0.7pt] coordinates {(2,0.373) (3,1.963) (4,6.381) (5,14.948) (6,31.320) (7,54.292) (8,84.295) (9,121.414) (10,178.508) (11,237.425) (12,322.802) (13,418.977) (14,538.122) (15,631.010) (16,738.971) (17,911.397) (18,1094.908) (19,1241.910) (20,1624.097)};
	   \addlegendentry{LS}
	   \addplot[color=blue,mark=triangle,mark size=2pt, line width=0.7pt] coordinates {(2,2.661) (3,4.678) (4,7.372) (5,10.863) (6,15.064) (7,19.579) (8,23.505) (9,29.518) (10,35.566) (11,41.104) (12,48.891) (13,56.413) (14,66.019) (15,71.337) (16,75.876) (17,85.122) (18,95.151) (19,99.033) (20,134.680)};
	   \addlegendentry{M}
	   \addplot[color=black,mark=o,mark size=2pt, line width=0.7pt] coordinates {(2,0.409) (3,0.689) (4,1.076) (5,1.553) (6,2.136) (7,2.719) (8,3.204) (9,3.963) (10,4.653) (11,5.267) (12,6.136) (13,6.927) (14,7.912) (15,8.304) (16,8.651) (17,9.587) (18,10.707) (19,10.777) (20,13.839)};
	   \addlegendentry{G}
	\end{axis}
	\end{tikzpicture}
	\caption{Algorithm running time over synthetic data }
	\label{randomtime}
	\end{figure}
	

From the figures, one can see that \ls, \matching and \greedy generate allocations with a much higher average fair probability than \baseline when the number of agents is at least $5$.
Besides, when the number of agents $n$ increases, the running time of \ls increases significantly, while \baseline, \matching, and \greedy keep low running time.
In summary, \greedy and \matching require the least running time and perform the best consistently for different values of $n$.
%\ls requires a much longer running time, yet still has a performance slightly worse than the other two algorithms.
% , while \matching has the best performance  with similar running time. is not much worse than that of $G$ and obviously better than that of $LS$ and $M$.
% When the number of agents $n$ increases, the performance of \baseline drops significantly, while \ls, \matching, and \greedy keep good performance. In particular, \matching always performs the best with a consistent running time across different values of $n$.

% We further summarize the average fair probability and running time of each algorithm across all datasets as follows. The performance comparison is consistent with that under each $n$. 

% \vspace{1ex}
% \begin{tabular}{lll}
% 	& Average Fair Probability & Average Running Time \\
% 	B & 0.6607 & 136.01ms \\
% 	LS & 0.9018 & 647.13ms \\
% 	M & 0.9112 & 65.90ms \\
% 	G & 0.9020 & 7.55ms \\
% \end{tabular}
% \vspace{1ex}

\subsubsection{Real dataset}

Table \ref{realdataper} presents the fair probabilities of the suggested allocations by each algorithm on 11 real datasets. 
Table \ref{realdatatime} further provides their running times.
In the real datasets, \baseline still performs the worst. The other three algorithms can generate allocations that are fair with probability $1$ for most cases, with two exceptions for \ls and one exception for \greedy. \matching is the only algorithm that performs consistently well. In terms of the running time, \ls takes much longer than the other three. The  \baseline and \matching take a little more time than \greedy. But it is still acceptable.
\begin{table}[!htbp]
	\centering
	\caption{Fair probability of all algorithms over real data (sorted by the number of agents $n$)}
    %\renewcommand\tabcolsep{5.0pt}
	\begin{threeparttable}
        \scalebox{0.75}{
		\begin{tabular}{|c|c|c|c|c|c|c|}
			\hline
			no.& n & m & B & LS & M & G \\
			\hline
			1 & 24 & 52 & 0.03 & 1.00 & 1.00 & 1.00 \\
			\hline
			2 & 31 & 54 & 0.11 & 1.00 & 1.00 & 1.00 \\
			\hline
			3 & 31 & 103 & 0.02 & 1.00 & 1.00 & 1.00 \\
			\hline
			4 & 32 & 102 & 0.06 & 1.00 & 1.00 & 1.00 \\
			\hline
			5 & 34 & 63 & 0.23 & 1.00 & 1.00 & 1.00 \\
			\hline
			6 & 35 & 61 & 0.01 & 1.00 & 1.00 & 1.00 \\
			\hline
			7 & 37 & 56 & 0.00 & 0.01 & 1.00 & 1.00 \\
			\hline
			8 & 38 & 133 & 0.03 & 1.00 & 1.00 & 1.00 \\
			\hline
			9 & 51 & 147 & 0.28 & 1.00 & 1.00 & 1.00 \\
			\hline
			10 & 51 & 155 & 0.00 & 1.00 & 1.00 & 1.00 \\
			\hline
			11 & 146 & 176 & 0.00 & 0.00 & 1.00 & 0.37 \\
			\hline
		\end{tabular}}
	\end{threeparttable}
    \label{realdataper}
\end{table}

\begin{table}[!htbp]
	\centering
	\caption{Running time(s) of all algorithms over real data (sorted by the number of agents $n$)}
    %\renewcommand\tabcolsep{5.0pt}
	\begin{threeparttable}
        \scalebox{0.75}{
		\begin{tabular}{|c|c|c|c|c|c|c|}
			\hline
			no. & n & m & B & LS & M & G \\
			\hline
			1 & 24 & 52 & 0.074 & 0.908 & 0.058 & 0.003 \\
			\hline
			2 & 31 & 54 & 0.078 & 1.017 & 0.075 & 0.005 \\
			\hline
			3 & 31 & 103 & 1.008 & 29.54 & 0.212 & 0.024 \\
			\hline
			4 & 32 & 102 & 1.127 & 40.02 & 0.264 & 0.025 \\
			\hline
			5 & 34 & 63 & 0.143 & 0.738 & 0.120 & 0.006 \\
			\hline
			6 & 35 & 61 & 0.172 & 1.798 & 0.140 & 0.006 \\
			\hline
			7 & 37 & 56 & 0.126 & 2.531 & 0.131 & 0.006 \\
			\hline
			8 & 38 & 133 & 2.148 & 63.73 & 0.388 & 0.039 \\
			\hline
			9 & 51 & 147 & 2.410 & 9.612 & 0.618 & 0.039 \\
			\hline
			10 & 51 & 155 & 3.250 & 480.7 & 0.687 & 0.055 \\
			\hline
			11 & 146 & 176 & 3.559 & 9255 & 5.533 & 0.064 \\
			\hline
		\end{tabular}}
	\end{threeparttable}
    \label{realdatatime}
\end{table}

% while $LS$ gives very poor performance in two data and $G$ gives a bad performance in the data with $n=146,m=176$, while $M$ still gives good performance in all cases. For running time,
% \vspace{2ex}
In conclusion, according to the results from both synthetic and real data, \ls has a good performance at a high computation cost. \greedy has decent performance with the best computation efficiency. \matching is a balanced algorithm with consistently good performance and high computation efficiency.


\section{Conclusions}

In this paper, we present algorithmic and complexity results in computing fair allocations assuming agents' preferences over items are ordinal and have uncertainties. Under the proposed fair notions, we provide polynomial-time solvable algorithms to find the probability that a given allocation is fair and determine whether there exists an allocation with non-zero fair probability. We show that it is NP-hard to see whether there exists an allocation that is fair with probability one. Finally, we show that to find an allocation with the highest fair probability is NP-hard. We further provide several heuristics for this problem. The performance of the heuristics is examined thoroughly on both synthetic and real datasets. 
One possible direction for future work is to consider other fairness concepts in the context of ordinal and uncertain preferences and study approximation algorithms to find fair allocations. It is also interesting to combine the fairness notions with other properties such as stability in the uncertain ordinal preference setting.

% \section{General Formatting Instructions}
% As a general rule: \emph{follow the template}.

% \subsection{Authorship}
% Reviewing is double-blind.
% However, you can already fill in your author names and affiliations in the \verb|\author| block in the preamble following the example of the template because the class will remove it as long as the option \textsf{accepted} is not passed to the class.
% Nevertheless, make sure any other information in the paper does not disclose your identity, for example URLs to supplementary material.

% \subsection{Sectioning}
% Three numbered sectioning commands are provided: \verb|\section|, \verb|\subsection|, and \verb|\subsubsection|.
% Please respect their order, so do not put a \verb|\subsubsection| directly beneath a \verb|\section|.
% One unnumbered sectioning command is provided, \verb|\paragraph|.
% It can be used directly below any numbered section level.
% Do not use any other sectioning commands.

% \subsubsection{Typing the Section Titles}
% The \verb|\section| and \verb|\subsection| titles are uppercased by the class.
% Please type them in title case.
% (This is used in the PDF bookmarks.)
% Please also write the \verb|\subsubsection| titles in title case.

% \paragraph{What is title case?}
% \href{https://en.wikipedia.org/wiki/Title_case}{Wikipedia} explains:
% \begin{quote}
%     Title case or headline case is a style of capitalization used for rendering the titles of published works or works of art in English.
%     When using title case, all words are capitalized except for ‘minor’ words (typically articles, short prepositions, and some conjunctions) unless they are the first or last word of the title.
% \end{quote}

% \subsection{References, Citations, Footnotes}\label{sec:etc}
% \subsubsection{Cross-Referencing}
% Always use \verb|\label| and \verb|\ref|—or a command with a similar effect—when cross-referencing.
% For example, this subsection is Section~\ref{sec:etc}.

% \subsubsection{Citations}
% Citations should include the author's last name and year.
% They should be part of the sentence.
% An example parenthetical citation: “Good introductions to the topic are available \citep{latexcompanion}.”
% An example textual citation: “\citet{einstein} discusses electrodynamics of moving bodies.”
% Do not use a parenthetical citation where a textual one is appropriate.
% An example of what \emph{not} to do: “\citep{einstein} discusses electrodynamics of moving bodies.”

% We strongly advise to use reference list software such as Bib\TeX{} and a citation package such as \textsf{natbib}.
% The reference style you use should be compatible with the author-year citations.
% Both the citation style and reference style used should be consistent.

% For the original submission, take care not to reveal the authors' identity through the manner in which one's own previous work is cited.
% For example, writing
% “I discussed electrodynamics of moving bodies before \citep{einstein}.” would be inappropriate, as it reveals the author's identity.
% Instead, write “\citet{einstein} discussed electrodynamics of moving bodies.”

% \subsubsection{Footnotes}
% You can include footnotes in your text.\footnote{
%     Use footnotes sparingly, as they can be distracting, having readers skip back and forth between the main text and the foot of the page.
% }
% The footnote mark should follow the fragment to which it refers, so a footnote\footnote{
%     A footnote is material put at the foot of a page.
% }
% for a word has a footnote mark attached to that word and a footnote for a phrase or sentence has a footnote mark attached to the closing punctuation.

% \section{Math}\label{sec:math}
% The class file does not load any math support package like \textsf{amsmath}\footnote{%
%   See the \textsf{amsmath} documentation at \url{https://ctan.org/pkg/amsmath} for further details.
% }.
% We advise using the \textsf{mathtools}\footnote{%
%   See the \textsf{mathtools} documentation at \url{https://ctan.org/pkg/mathtools} for further details.
% }
% package, which extends \textsf{amsmath} with fixes and even more useful commands.
% Feel free to load other support packages for symbols, theorems, etc.

% Use the \textsf{amsmath} environments for displayed equations.
% So, specifically, use the \texttt{equation} environment instead of \verb|$$...$$| and the \texttt{align} environment instead of \texttt{eqnarray}.\footnote{For reasons why you should not use the obsolete \texttt{eqnarray} environment, see Lars Madsen, \textit{Avoid eqnarray!} TUGboat 33(1):21--25, 2012.}
% An \texttt{equation}:
% \begin{equation}\label{eq:example}
%   0 = 1 - 1.
% \end{equation}
% Two \texttt{align}'ed equations:
% \begin{align*} % no numbers with starred version
%   1 + 2 &= 3,\\
%   1 - 2 &= -1.
% \end{align*}
% Equations can also be put inline, of course.
% For example, Equation~\eqref{eq:example}: \(0=1+1\). % $0=1+1$ also works
% (Notice that both inline and displayed math are part of the sentence, so punctuation should be added to displayed math.)

% The \textsf{amsmath} and \textsf{mathtools} packages provide a lot of nice functionality, such as many common math operators, e.g., \(\sin\) and \(\max\), and also commands for defining new ones.

% \section{Floats}\label{sec:floats}
% Floats, such as figures, tables and algorithms, are moving objects and are supposed to float to the nearest convenient location.
% Please do not force them to go in the middle of a paragraph.
% They must respect the column width.

% Two-column floats are possible.
% They appear at the top of the next page, so strategic placement may be necessary.
% For an example, see Figure~\ref{fig:tikz}.
% They may not enter the margins.
% \begin{figure*}
%     \centering
%     \begin{tikzpicture}[xscale=1.5]
%         \coordinate (origin);
%         \draw[->] (origin) -- +(1cm,0) node[below] {$x$};
%         \draw[->] (origin) -- +(0,1cm) node[left] {$y$};
%         \fill[gray] (45:1cm) circle[radius=.2cm];
%     \end{tikzpicture}
%     \caption{A Nice Filled Ellipse with a Pair of Coordinate Axes.}\label{fig:tikz}
% \end{figure*}

% All material in floats should be legible and of good quality.
% So avoid very small or large text and pixelated or fuzzy lines.

% \subsection{Figures}\label{sec:figures}
% Figures should go in the \texttt{figure} environment and be centered therein.
% The caption should go below the figure.
% Use \verb|\includegraphics| for external graphics files but omit the file extension.
% Supported formats are \textsf{pdf} (preferred for vector drawings and diagrams), \textsf{png} (preferred for screenshots), and \textsf{jpeg} (preferred for photographs).
% Do not use \verb|\epsfig| or \verb|\psfig|.
% If you want to scale the image, it is better to use a fraction of the line width rather than an explicit length.
% For example, see Figure~\ref{fig:toronto}.
% \begin{figure}
%   \centering
%   \includegraphics[width=0.7\linewidth,page=3]{toronto}
%   \caption{A View of a Nice City.}\label{fig:toronto}
% \end{figure}

% Do not use \verb|\graphicspath|.
% If the images are contained in a subdirectory, specify this when you include the image, for example \verb|\includegraphics{figures/mypic}|.

% \subsection{Tables}\label{sec:tables}
% Tables should go in the \texttt{table} environment and be centered therein.
% The caption should go above the table and be in title caps.
% For an example, see Table~\ref{tab:data}.
% \begin{table}
%     \centering
%     \caption{An Interesting Table.}\label{tab:data}
%     \begin{tabular}{rl}
%       \toprule % from booktabs package
%       \bfseries Dataset & \bfseries Result\\
%       \midrule % from booktabs package
%       Data1 & 0.12345\\
%       Data2 & 0.67890\\
%       Data3 & 0.54321\\
%       Data4 & 0.09876\\
%       \bottomrule % from booktabs package
%     \end{tabular}
% \end{table}

% \subsection{Algorithms}\label{sec:algorithms}
% You can load your favorite algorithm package, such as \textsf{algorithm2e}\footnote{See the \textsf{algorithm2e} documentation at \url{https://ctan.org/pkg/algorithm2e}.}.
% Use the environment defined in the package to create a centered float with an algorithm inside.

% \section{Back Matter}
% There are a some final, special sections that come at the back of the paper, in the following order:
% \begin{itemize}
%   \item Author Contributions
%   \item Acknowledgements
%   \item References
% \end{itemize}
% They all use an unnumbered \verb|\subsubsection|.

% For the first two special environments are provided.
% (These sections are automatically removed for the anonymous submission version of your paper.)
% The third is the ‘References’ section.
% (See below.)

% (This ‘Back Matter’ section itself should not be included in your paper.)

% \begin{contributions} % will be removed in pdf for initial submission,
%                       % so you can already fill it to test with the
%                       % ‘accepted’ class option
%     Briefly list author contributions.
%     This is a nice way of making clear who did what and to give proper credit.

%     H.~Q.~Bovik conceived the idea and wrote the paper.
%     Coauthor One created the code.
%     Coauthor Two created the figures.
% \end{contributions}

% \begin{acknowledgements} % will be removed in pdf for initial submission,
%                          % so you can already fill it to test with the
%                          % ‘accepted’ class option
%     Briefly acknowledge people and organizations here.

%     \emph{All} acknowledgements go in this section.
% \end{acknowledgements}

\bibliography{li_262}

% \appendix
% % NOTE: necessary when ptmx or no mathfont class option is given
% \providecommand{\upGamma}{\Gamma}
% \providecommand{\uppi}{\pi}
% \section{Math font exposition}
% How math looks in equations is important:
% \begin{equation*}
%   F_{\alpha,\beta}^\eta(z) = \upGamma(\tfrac{3}{2}) \prod_{\ell=1}^\infty\eta \frac{z^\ell}{\ell} + \frac{1}{2\uppi}\int_{-\infty}^z\alpha \sum_{k=1}^\infty x^{\beta k}\mathrm{d}x.
% \end{equation*}
% However, one should not ignore how well math mixes with text:
% The frobble function \(f\) transforms zabbies \(z\) into yannies \(y\).
% It is a polynomial \(f(z)=\alpha z + \beta z^2\), where \(-n<\alpha<\beta/n\leq\gamma\), with \(\gamma\) a positive real number.

\end{document}
