Skip to content

Latest commit

 

History

History
33 lines (32 loc) · 1.05 KB

strcture.md

File metadata and controls

33 lines (32 loc) · 1.05 KB
  • read file

    • store vertex (position, index)
    • store edge <v1, v2>, add &it to v1, v2's pair set
    • store plane <v1, v2, v3>
  • build heap

    • traverse plane, cal a, b, c, d
      • add to Q of v1, v2, v3
    • traverse (vi, vj)
      • judge if it's edge (search vj in vi's neighbor)
        • if not edge
          • judge t
            • if t
              • add pair
      • cal cost, add cost to pair(edge)
      • cal v, add to pair(edge)
      • add into heap
  • test

  • remove point from heap

    • judge number
    • replace v1 with v
    • mark v2 as deleted, add "merge to v1" mark
    • remove top of heap
    • traverse pair* set of to v2, add v2's pair set to v1's
    • update Q of v1
    • traverse pair next to v1, update cost and v, update heap
  • write to file

    • traverse vertex
      • write undeleted vertex, update index
      • if v is deleted, use merge to to find the real position, use stack to update index.
    • traverse plane
      • traverse v1, v2, v3
        • if not vi's index = vj's index write plane.