Divide-and-Conquer(분할정복법)

2011. 1. 7. 17:06·Algorithms/Divide-and-Conquer

Basic Concept


Divide-and-conquer is patterned after the brilliant strategy employed by the French emperor Napoleon in the Battle of Austerlitz on December 2, 1805. A combined army of Austrians and Russians outnumbered Napoleon’s army by about 15,000 soldiers. The Austro-Russian army launched a massive attack against the French right flank. Anticipating their attack, Napoleon drove against their center and split their forces in two. Because the two smaller armies were individually no match for Napoleon, they each suffered heavy losses and were compelled to retreat. By dividing the large army into two smaller armies and individually conquering these two smaller armies, Napoleon was able to conquer the large army.

 

👉 분할정복법은 아우스터리츠 전투에서 프랑스 황제 나폴레옹이 구사한 전략을 본 떠서 만든 것이다. 프랑스군은 오스트리아와 러시아 연합군에 비해 수적으로 열세였지만, 나폴레옹이 적 중앙을 돌파하여 적의 부대를 둘로 나누고 각개격파함으로써 전쟁에서 승리할 수 있었다.

 

 

The Divide-and-Conquer Approach


It divides an instance of a problem into two or more smaller instances. The smaller instances are usually instances of the original problem. If solutions to the smaller instances can be obtained readily, the solution to the original instance can be obtained by combining these solutions. If the smaller instances are still too large to be solved readily, they can be divided into still smaller instances. This process of dividing the instances continues until they are so small that a solution is readily obtainable. The divide-and-conquer approach is a top-down approach.

 

Top-down Approach

1. Divide

문제를 해결하기 쉽도록 여러 개의 작은 부분으로 나눈다. 이 작은 문제들은 원래 문제의 한 부분이다.

 

2. Conquer - Solve

나눈 문제를 각각 해결한다. 만약 문제가 여전히 커서 쉽게 해결되지 않으면 더 작은 부분으로 나눈다.

 

3. Combine - Obtain the solution

필요하다면 해결된 해답을 모은다.

 

👉 분할정복법은 top-down 방식으로 문제를 해결한다.

 

 

 

When Not to Use Divide-and-Conquer


If possible, we should avoid divide-and-conquer in the following two cases. The first partitioning leads to an exponential-time algorithm, where the second leads to a nΘ(logn) algorithm. Neither of these is acceptable for large values of n.

 

Case 1. An instance of size n is divided into or more instances each almost of size n.

입력크기가 n인 문제를 분할하는 과정에서, 각 분할된 문제의 크기가 거의 n인 두 개 이상의 인스턴스로 나뉘는 경우라면 분할정복법 사용을 피해야 한다. 피보나찌 수열을 예로 들면, fib(n)을 구하기 위해 문제를 fib(n-1)과 fib(n-2)로 분할했지만 전체 문제의 크기는 처음 가지고 있던 것보다 더 커져 비효율적인 결과를 초래한다. (n < 2n-3)

// n th Fibonacci Term (Recursive)
fib(n) = fib(n-1) + fib(n-2) // n < 2n-3
👉 첫 번째와 같이 문제를 분할하면 시간복잡도가 지수시간(exponential-time)인 알고리즘이 나온다.

 

Case 2. An instance of size n is divided into almost n instances of size n/c, where c is a constant

입력크기가 n인 문제를 분할하는 과정에서, 거의 n개의 n/c(c는 상수) 크기 인스턴스로 나뉘는 경우라면 분할정복법 사용을 피해야 한다.

 

👉 두 번째와 같이 문제를 분할하면 시간복잡도가 n*Θ(logn)인 알고리즘이 나온다. 입력크기 n 값이 크다면 이 중 어떤 것도 받아들일 수 없다.
결론적으로 입력크기 n 값이 크다면 이 중 어떤 것도 받아들일 수 없다. 따라서 상기 두 가지 경우처럼 분할했을 때의 크기가 처음 가지고 있던 문제의 크기 보다 커지거나 혹은 비슷하다면 분할정복법 사용을 지양해야 한다.

'Algorithms > Divide-and-Conquer' 카테고리의 다른 글

Quicksort(퀵정렬)  (0) 2011.01.07
Mergesort(합병정렬)  (0) 2011.01.07
Binary Search(이진탐색)  (0) 2011.01.07
'Algorithms/Divide-and-Conquer' 카테고리의 다른 글
  • Quicksort(퀵정렬)
  • Mergesort(합병정렬)
  • Binary Search(이진탐색)
Zakarum
Zakarum
  • Zakarum
    Zakr. _archives
    Zakarum
  • 전체
    오늘
    어제
    • Zakarum
      • Cogito, ergo sum
      • Algorithms
        • Eff, Anal, and Order
        • Divide-and-Conquer
        • Dynamic Programming
        • The Greedy Approach
        • Backtracking
        • Branch-and-Bound
      • Et Cetera
        • Job-seeking
      • Not Public
        • MBA
        • 2.3. Civil•Commercial Law
        • 2.2. Credit Analysis (Basic..
        • 2.4. Foreign Exchange
        • 2.1. Accounting Principles ..
        • ITSM
        • Theory of NP
  • 블로그 메뉴

    • 홈
    • 태그
    • 방명록
    • 글쓰기
  • 링크

  • 공지사항

  • 인기 글

  • 태그

    소프트웨어공학
    SNU MBA
    os concept
    신용분석기초
    동적계획법
    process management
    미국여행
    이탈리아여행
    회계원리기초1
    자바스크립트
    외국환
    ITIL
    분할정복법
    0-1 배낭 문제
    탐욕 알고리즘
    네트워크
    process scheduling
    일본여행
    금융IT 채용정보
    p-np problem
    재무회계
    분기한정법
    백트래킹
    대만여행
    회계원리기초2
    베트남여행
    알고리즘
    민상법기초1
    최소신장트리
    민상법기초3
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.5
Zakarum
Divide-and-Conquer(분할정복법)
상단으로

티스토리툴바