\begin{algorithmic}
\Require adjacency matrix $e(j,k)$, $j, k \in X$ and $o\in B$
\Ensure $p(d,j) \in \{0, 1\}$, $d = 1,\dots, n - 1$, $j \in X \setminus \{o\}$, satisfies (P)
\ForAll{$j \in X \setminus \{o\}$}
    \If{$e(o,j)=1$}
        \State $p(1,j) \gets 1$
    \Else
        \State $p(1,j) \gets 0$
    \EndIf
\EndFor
\For{$d = 2,\dots,n - 1$}
    \ForAll{$j \in X \setminus \{o\}$}
        \ForAll{$k \in X \setminus \{o,j\}$}
            \If{$p(d-1, k) = 1$ and $e(k, j) = 1$}
                \State $a(k) \gets 1$
            \Else
                \State $a(k) \gets 0$
            \EndIf
        \EndFor 
        \If{$p(d-1,j) = 1$ or $a(k) = 1$ for some $k \in X \setminus \{o,j\}$}
            \State $p(d,j) \gets 1$
        \Else
            \State $p(d,j) \gets 0$
        \EndIf
    \EndFor 
\EndFor 
\end{algorithmic}

\begin{algorithmic}
\Require adjacency matrix $e(j,k)$, $j, k \in X$ and $o\in B$
\Ensure $p(d,j) \in \{0, 1\}$, $d = 1,\dots, n - 1$, $j \in X \setminus \{o\}$, satisfies (P)
\ForAll{$j \in X \setminus \{o\}$}
\If{$e(o,j)=1$}
\State $p(1,j) \gets 1$
\Else
\State $p(1,j) \gets 0$
\EndIf
\EndFor
\For{$d = 2,\dots,n - 1$}
\ForAll{$j \in X \setminus \{o\}$}
\ForAll{$k \in X \setminus \{o,j\}$}
\If{$p(d-1, k) = 1$ and $e(k, j) = 1$}
\State $a(k) \gets 1$
\Else
\State $a(k) \gets 0$
\EndIf
\EndFor
\If{$p(d-1,j) = 1$ or $a(k) = 1$ for some $k \in X \setminus \{o,j\}$}
\State $p(d,j) \gets 1$
\Else
\State $p(d,j) \gets 0$
\EndIf
\EndFor
\EndFor
\end{algorithmic}
{
    "title": "quantum computing algorithms for inverse problems on graphs and an   np-complete inverse problem",
    "id": "2306.05253",
    "abstract": "we consider an inverse problem for a finite graph $(x,e)$ where we are given a subset of vertices $b\\subset x$ and the distances $d_{(x,e)}(b_1,b_2)$ of all vertices $b_1,b_2\\in b$. the distance of points $x_1,x_2\\in x$ is defined as the minimal number of edges needed to connect two vertices, so all edges have length 1. the inverse problem is a discrete version of the boundary rigidity problem in riemannian geometry or the inverse travel time problem in geophysics. we will show that this problem has unique solution under certain conditions and develop quantum computing methods to solve it. we prove the following uniqueness result: when $(x,e)$ is a tree and $b$ is the set of leaves of the tree, the graph $(x,e)$ can be uniquely determined in the class of all graphs having a fixed number of vertices. we present a quantum computing algorithm which produces a graph $(x,e)$, or one of those, which has a given number of vertices and the required distances between vertices in $b$. to this end we develop an algorithm that takes in a qubit representation of a graph and combine it with grover's search algorithm. the algorithm can be implemented using only $o(|x|^2)$ qubits, the same order as the number of elements in the adjacency matrix of $(x,e)$. it also has a quadratic improvement in computational cost compared to standard classical algorithms. finally, we consider applications in theory of computation, and show that a slight modification of the above inverse problem is np-complete: all np-problems can be reduced to a discrete inverse problem we consider.",
    "categories": "math.co cs.cc quant-ph",
    "doi": "",
    "created": "2023-06-08",
    "updated": "2024-02-12",
    "authors": [
        "joonas ilmavirta",
        "matti lassas",
        "jinpeng lu",
        "lauri oksanen",
        "lauri ylinen"
    ],
    "affiliation": [],
    "url": "https://arxiv.org/abs/2306.05253"
}
{
    "ToxicityFilter": {
        "text_to_toxicity_attributes": {
            "main.tex": {
                "toxicity_score": 0.01608456,
                "severe_toxicity_score": 0.0018119812,
                "identity_attack_score": 0.005660672,
                "insult_score": 0.008329881,
                "profanity_score": 0.018734055,
                "threat_score": 0.008440462,
                "sexually_explicit_score": 0.019698374,
                "flirtation_score": 0.23309484
            },
            "main.bbl": {
                "toxicity_score": 0.017843807,
                "severe_toxicity_score": 0.0013160706,
                "identity_attack_score": 0.00362579,
                "insult_score": 0.009374888,
                "profanity_score": 0.017299367,
                "threat_score": 0.00746953,
                "sexually_explicit_score": 0.013800657,
                "flirtation_score": 0.47433925
            }
        },
        "reason": null
    }
}
{
    "num_done": {
        "figure": 0,
        "algorithm": 2,
        "plot": 3
    }
}
{
    "NonTrivialRenderingFilter": {
        "white_pixels_ratio": 67.97341204952325,
        "hash": "3c3cbde7e7fd383c",
        "most_frequent_color_ratio": 67.97341204952325
    }
}