[CE] Linear Search, Naive Search, Brute Force Search

2024. 11. 16. 09:10·Computer/CE
728x90
728x90

Linear Search (Naive Search)

The simplest solution to the Nearest Neighbor Search problem is
to compute the distance from the query point to every other point in the database,
keeping track of the "best so far".

이 방식에서는 모든 가능한 데이터를 하나하나 비교하여, 원하는 결과를 찾는 방식.

  • 따라서, 탐색 데이터 구조를 활용하지 않고,
  • 단순히 데이터베이스의 모든 항목을 순차적으로 검사

Linear Search는 Naive Search 또는 Brute Force Search라고도 불리며,

$O(dN)$의 시간 복잡도를 가짐

  • $N$ : the Cardinarlity of set (집합원소의 갯수, 데이터의 instance 갯수)
  • $d$ : 각 instance의 feature수 (vector의 차원수)

장점.

  • 탐색을 위한 추가적인 데이터 구조를 유지할 필요가 없음
  • Linear Search은 데이터 저장을 제외하고는 추가적인 공간 복잡도를 요구하지 않음.

재밌게도 이 간단한 Naive search 가
고차원의 공간에서는 k-d Tree, R-tree 등의 space partitioning approaches 보다
평균적으로 더 나은 성능을 보이는 경우가 많음.

mlist = []

# query point의 수만큼의 feature vectors
for i in img_model:
    shortest = float('inf')
    # target 영상의 feature vector 수만큼 반복
    for j in img_target:
        d = dist(i,j)
        if d < shortest:
            match = j
            shortest = d
    if shortest < Th:
        mlist.append((i,match))

참고자료

  • Weber, Schek, Blott. “A quantitative analysis and performance study for similarity search methods in high dimensional spaces”

 

'Computer > CE' 카테고리의 다른 글

[Ex] CMRR 및 특정 CMRR에서의 최소 신호값 구하기.  (0) 2025.03.25
[CE] 오늘날의 VLSI 분류  (0) 2025.03.25
[CE] Queue  (1) 2024.11.09
[CE] XML (eXtensible Markup Language)  (0) 2024.08.09
[CE] Bipartite Graph (이분그래프)  (0) 2024.08.06
'Computer/CE' 카테고리의 다른 글
  • [Ex] CMRR 및 특정 CMRR에서의 최소 신호값 구하기.
  • [CE] 오늘날의 VLSI 분류
  • [CE] Queue
  • [CE] XML (eXtensible Markup Language)
dsaint31x
dsaint31x
    반응형
    250x250
  • dsaint31x
    Dsaint31's blog
    dsaint31x
  • 전체
    오늘
    어제
    • 분류 전체보기 (739)
      • Private Life (13)
      • Programming (56)
        • DIP (104)
        • ML (26)
      • Computer (119)
        • CE (53)
        • ETC (33)
        • CUDA (3)
        • Blog, Markdown, Latex (4)
        • Linux (9)
      • ... (350)
        • Signals and Systems (103)
        • Math (171)
        • Linear Algebra (33)
        • Physics (42)
        • 인성세미나 (1)
      • 정리필요. (54)
        • 의료기기의 이해 (6)
        • PET, MRI and so on. (1)
        • PET Study 2009 (1)
        • 방사선 장해방호 (4)
        • 방사선 생물학 (3)
        • 방사선 계측 (9)
        • 기타 방사능관련 (3)
        • 고시 (9)
        • 정리 (18)
      • RI (0)
      • 원자력,방사능 관련법 (2)
  • 블로그 메뉴

    • Math
    • Programming
    • SS
    • DIP
  • 링크

    • Convex Optimization For All
  • 공지사항

    • Test
    • PET Study 2009
    • 기타 방사능관련.
  • 인기 글

  • 태그

    SS
    linear algebra
    Optimization
    math
    인허가제도
    opencv
    Term
    random
    Python
    signal_and_system
    Programming
    SIGNAL
    Vector
    Convolution
    numpy
    function
    signals_and_systems
    검사
    fourier transform
    Probability
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.3
dsaint31x
[CE] Linear Search, Naive Search, Brute Force Search
상단으로

티스토리툴바