Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> การเขียนโปรแกรม >> การเขียนโปรแกรม

R-Trees ในโครงสร้างข้อมูล


R-Trees คืออะไร

R-Trees ใช้จัดเก็บ Spatial Data Indexes อย่างมีประสิทธิภาพ เหมาะสำหรับ Spatial Queries และ Storage ใช้ใน:

  • Indexing ข้อมูลหลายมิติ (Multidimensional)
  • จัดการข้อมูลเกม (Game Data)
  • เก็บพิกัดภูมิศาสตร์ (Geospatial Coordinates)
  • Virtual Maps Implementation

ตัวอย่าง R-Tree

R-Trees ในโครงสร้างข้อมูล

R-Tree ที่สอดคล้อง:

R-Trees ในโครงสร้างข้อมูล

คุณสมบัติ R-Trees

  • ประกอบด้วย Single Root, Internal Nodes, Leaf Nodes
  • Root ชี้ไปยัง Region ใหญ่สุดใน Spatial Domain
  • Parent Nodes เก็บ Child Nodes ที่ Overlap Region ของ Parent สมบูรณ์
  • Leaf Nodes เก็บข้อมูล MBR ของ Object
  • MBR (Minimum Bounding Region) = กล่องขอบเขตขั้นต่ำที่ครอบคลุม Region

เปรียบเทียบกับ Quad-Trees

Quad TreeR-Tree
ต้องการ Tiling Level Optimizationไม่ต้องการ Optimization
สร้างบน B-Tree ได้ไม่ทำตามโครงสร้าง B-Tree
Spatial Index สร้างเร็วSpatial Index สร้างช้ากว่า
Nearest Neighbor ช้า, Window Query เร็วNearest Neighbor เร็ว, Window Query ช้า