<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Yihan Kim</title><link>http://www.yihan.kim/</link><description>Recent content on Yihan Kim</description><generator>Hugo</generator><language>ko-kr</language><lastBuildDate>Thu, 22 Jan 2026 00:00:00 +0900</lastBuildDate><atom:link href="http://www.yihan.kim/index.xml" rel="self" type="application/rss+xml"/><item><title>Methods of Four Russians</title><link>http://www.yihan.kim/algorithms/paradigms/2021-01-06-four-russians/</link><pubDate>Thu, 22 Jan 2026 00:00:00 +0900</pubDate><guid>http://www.yihan.kim/algorithms/paradigms/2021-01-06-four-russians/</guid><description>&lt;p&gt;&lt;em&gt;5년 전에 쓰다 만 글이 보여서 퇴고를 거쳐 올려둔다. 졸면서 쓰는 게 퇴고인가? 잘 모르겠다.&lt;/em&gt;&lt;/p&gt;
&lt;h3 id="개요"&gt;개요&lt;/h3&gt;
&lt;p&gt;알고리즘 문제를 (메모리 비트 길이 만큼)아주 작은 크기의 문제로 분할하여, 그 문제에 입력 가능한 모든 조합을 미리 계산해서 기억하고 꺼내다 쓰는 기법이다. $\log(n)$ 내지 $\log^2(n)$ 만큼 시간복잡도를 떨어트린다. 실용성에는 이견의 여지가 있겠으나, 패러다임을 적용한 알고리즘의 구현은 쉬운 편이다.
1970년 발표된 논문의 저자 네 명이 모스크바 대학 소속이라 Four Russians라는 이름이 붙었다고 알려져 있다.
방향 그래프의 이행적 폐쇄(transitive closure)를 찾는 기법의 일환으로 이진 행렬 곱셈(boolean matrix multiplication, 이하 BMM)을 사용하는데, 이 과정을 최적화하는 기법으로 처음 소개&lt;a href="http://www.mathnet.ru/php/archive.phtml?wshow=paper&amp;amp;jrnid=dan&amp;amp;paperid=35675&amp;amp;option_lang=eng"&gt;[1]&lt;/a&gt;되었다.&lt;/p&gt;</description></item><item><title>Separating (Non-Unit) Disk Graphs</title><link>http://www.yihan.kim/algorithms/2021-02-24-dg-separation/</link><pubDate>Wed, 24 Feb 2021 00:00:00 +0900</pubDate><guid>http://www.yihan.kim/algorithms/2021-02-24-dg-separation/</guid><description>&lt;h3 id="1-terminology"&gt;1. Terminology&lt;/h3&gt;
&lt;p&gt;&lt;img alt="GIG" loading="lazy" src="https://upload.wikimedia.org/wikipedia/commons/e/e9/Intersection_graph.gif"&gt; &lt;br&gt;
&lt;em&gt;Intersection graph from &lt;a href="https://en.wikipedia.org/wiki/Intersection_graph"&gt;Wikipedia&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;평면 위의 도형으로부터 &lt;em&gt;(Geometric) intersection graph&lt;/em&gt;를 유도할 수 있다.
그래프의 정점은 각 도형에 대응한다.
그리고, 두 정점에 대응하는 두 도형이 교차할 때 두 점 사이의 간선이 있다.&lt;/p&gt;
&lt;p&gt;&lt;img alt="UDG" loading="lazy" src="https://upload.wikimedia.org/wikipedia/commons/thumb/b/be/Unit_disk_graph.svg/1920px-Unit_disk_graph.svg.png"&gt; &lt;br&gt;
&lt;em&gt;Unit disk graph from &lt;a href="https://en.wikipedia.org/wiki/Unit_disk_graph"&gt;Wikipedia&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;교차 그래프의 특수한 예시로 &lt;em&gt;Unit disk graph&lt;/em&gt;(이하 UDG)가 있다.
UDG는 동일한 반지름을 가진 원으로 구성된 intersection graph이다.
UDG의 정점은 각 원의 중심 좌표로 정의된다.
그리고, 중심을 기준으로 만든 두 단위원이 교차할 때
중심을 이은 선분을 간선으로 취급한다.&lt;/p&gt;</description></item><item><title>Segment Dragging in Polygonal domain (1)</title><link>http://www.yihan.kim/algorithms/2020-10-21-rectangle_intersection/</link><pubDate>Wed, 21 Oct 2020 00:00:00 +0900</pubDate><guid>http://www.yihan.kim/algorithms/2020-10-21-rectangle_intersection/</guid><description>&lt;h3 id="problem-definition"&gt;Problem Definition&lt;/h3&gt;
&lt;p&gt;2차원 공간에서의 polygonal domain
$\Gamma = { \Gamma_1, \Gamma_2, \cdots, \Gamma_h }$를 생각하자.
더 정확히 말하자면, $h$개의 서로 겹치지 않는 다각형 장애물이 있고,
이 도형들이 가진 정점의 총 갯수는 $\sum_i{|\Gamma_i|} = n$이라 가정한다.&lt;/p&gt;
&lt;p&gt;어떤 선분 $s$가 주어졌을 때, 선분을 수직 방향으로 평행이동해서
(위, 아래로) 가장 먼저 닿는 다각형의 index와 교차하는 점을 구하여라.
($\tilde{O}(n + h^2)$ preprocessing / storage, $O(\log^c n)$ query)&lt;/p&gt;
&lt;h3 id="related-works"&gt;Related Works&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Segment dragging query&lt;/strong&gt;는, 주어진 선분을 움직여서 가장 먼저 마주치는 점을 찾는 문제이다. 1988년 Chazelle이 horizontal segment에 대한 dragging query를 $O(n \log n)$ preprocessing, $O(n)$ storage로 $O(\log n)$ 시간 안에 답하는 알고리즘을 소개했다.&lt;/p&gt;</description></item><item><title>Segment Dragging in Polygonal domain (2)</title><link>http://www.yihan.kim/algorithms/2020-10-23-spsq-sketch/</link><pubDate>Wed, 21 Oct 2020 00:00:00 +0900</pubDate><guid>http://www.yihan.kim/algorithms/2020-10-23-spsq-sketch/</guid><description>&lt;p&gt;&lt;em&gt;Haitao 선생님께서 키 문제를 풀어버려서 contribution이 날아갔다.&lt;/em&gt;&lt;/p&gt;
&lt;h3 id="problem"&gt;Problem&lt;/h3&gt;
&lt;p&gt;Polygonal domain $\mathcal{P}$와, free space 위의 정점 $s$가 주어졌다고 가정하자.
&lt;em&gt;shortest path to a segment query&lt;/em&gt;(SPSQ)는 free space 위의 간선 $\ell$이 주어지면 $s$에서 $\ell$까지의 최단 거리를 반환하는 문제이다.
짧게 쓰면 아래와 같다.&lt;/p&gt;
&lt;p&gt;$$
(\mathcal{P}, s) \mapsto \left( \ell \mapsto | \pi_\mathcal{P}(s, \ell) |
:= \min_{t \in \ell}| \pi_\mathcal{P}(s, t) | \right)
$$&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;목표 : $\tilde{O}(n + h^2)$ preprocessing, storage &amp;amp; $O(\log^c n)$ queries&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="strategy"&gt;Strategy&lt;/h3&gt;
&lt;h4 id="1-extended-corridor--extended-ocean"&gt;1. Extended Corridor &amp;amp; Extended Ocean&lt;/h4&gt;
&lt;p&gt;Chen, Wang의 &lt;em&gt;Extended Corridor structure&lt;/em&gt;를 구성한다. [Chen, 2015]&lt;/p&gt;</description></item><item><title>Parametric Search</title><link>http://www.yihan.kim/algorithms/paradigms/2020-10-15-parametric-search/</link><pubDate>Thu, 15 Oct 2020 00:00:00 +0900</pubDate><guid>http://www.yihan.kim/algorithms/paradigms/2020-10-15-parametric-search/</guid><description>&lt;p&gt;&lt;em&gt;1983 Meggido의 parametric search는 경시대회에서 사용하는 기법의 일반화된 버전이다.
알고리즘의 이론적 시간 복잡도를 기술할 때 지금도 쓰이는 기법이지만 한글로 검색이 잘 안 되어서 한 번 적어본다.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;$f_a : \mathbb{R} \rightarrow {0, 1}$을 아래와 같이 정의하자.&lt;/p&gt;
&lt;p&gt;$$
f_a(x) =
\left{
\begin{array}{ll}
1 &amp;amp; x \le a \
0 &amp;amp; x &amp;gt; a
\end{array}
\right.
$$&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;$a \in \mathbb{R}$를 모르는 monotone 함수 $f$를 유한 번 테스트해서 $a$를 알 수 있을까?&lt;/strong&gt;
이진 탐색을 써서 Cauchy 수열을 만들 수는 있겠지만,
$a = n / 2^m$ 꼴이 아닌 이상 유한 번의 실행으로 값을 단정할 수는 없다.
실수 값을 해 집합(solution space)으로 가지는 일반적인 함수의 경우,
죽었다 깨어나도 블랙박스 테스트만으로 정확한 해를 구할 수는 없다.
대신, $x$를 받아 유한 번의 (낮은 차수 다항식의) 비교 연산을 실행하고,
계산 결과 $f(x)$를 반환하는 알고리즘 $A$가 있다면 이야기가 달라진다.&lt;/p&gt;</description></item><item><title>The Power of Grid</title><link>http://www.yihan.kim/algorithms/2020-07-02-grid/</link><pubDate>Mon, 29 Jun 2020 00:00:00 +0900</pubDate><guid>http://www.yihan.kim/algorithms/2020-07-02-grid/</guid><description>&lt;p&gt;&lt;em&gt;Geometric Approximation Algorithms(Sariel Har-Peled 저)의 1장 내용입니다.&lt;/em&gt;&lt;/p&gt;
&lt;h3 id="preliminaries"&gt;Preliminaries&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;특정 &lt;em&gt;width&lt;/em&gt; $r &amp;gt; 0$을 가지는 &lt;em&gt;Grid&lt;/em&gt;는 아래 함수로 정의&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;$$
\begin{align*}
G_r : \mathbb{R}^2 &amp;amp;\rightarrow (r\mathbb{N})^2 = {(ri, rj) : i, j \in \mathbb{N}} \
(x, y) &amp;amp;\mapsto ([\frac{x}{r}]r, [\frac{y}{r}]r)
\end{align*}
$$&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;$G_r$은 평면 공간을 정사각형 영역으로 분할하는데, 각 영역을 &lt;em&gt;cell&lt;/em&gt;이라 부른다.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;$3 \times 3$ 개의 연속한 grid cell을 &lt;em&gt;grid cluster&lt;/em&gt;라고 정의&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;각 cell은 idx를 가진다($\text{id}(p) = (\frac{x}{r}, \frac{y}{r})$)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;정점 $p = (x, y) \in \mathbb{R}^2$에 대해 $G_r(p) \in (r\mathbb{N})^2$&lt;/p&gt;</description></item></channel></rss>