Sorting, packing and network algorithms
도입됨
16:11
결정론 수학 1
WDM 시험지01: 1 시간 30 분, 75 점수. 모든 방법은 알고리즘이며, 점수는 이를 정확히 수행한 결과입니다: 각 pass 후 목록, 각 배치 위치…
영어 내레이션 · 영어와 중국어 자막 전환 가능
이 수업의 내용
| English | 의미 |
|---|---|
| route inspection/ruːt ɪnˈspekʃn/ | Finding the shortest closed route that travels along every edge of a network at least once. |
| algorithm/ˈælɡərɪθəm/ | 알고리즘 |
| sorting/ˈsɔːtɪŋ/ | Putting a list of items into order, such as ascending order. |
| bin packing/bɪn ˈpækɪŋ/ | Fitting items of given sizes into the fewest bins of a fixed capacity. |
| pivot/ˈpɪvət/ | The item chosen in quick sort, around which the list is split into smaller and larger items. |
| optimal/ˈɒptɪml/ | Describes the best possible solution to a problem. |
| degree/dɪˈɡriː/ | An angular unit equal to one three-hundred-and-sixtieth of a full turn. |
| heuristic/hjuːˈrɪstɪk/ | Describes a method that finds a good solution quickly but does not guarantee the best one. |
빠른 포장 방법이 항상 최적입니까?
- 포장 방법은 상자를 빠르게 채울 수 있으나, 유효한 빠른 배치 방식이 반드시 가장 적은 상자를 사용해야 하는 것은 아닙니다.
- 이 수업에서는 알고리즘을 다룹니다: 정의된 문제 유형의 해법을 제공하는 유한한 순서 Instruction(명령)의 집합입니다.
해결 방법
- 명시된 알고리즘을 정확히 추적하되, 동점 처리 규칙을 포함하십시오.
- 첫 번째 적합 포장法에서는 각 항목을 수용할 수 있는 가장 먼저 사용 가능한 상자에 배치하십시오.
- 감소형 첫 번째 적합법은 적용 전에 먼저 정렬합니다.
- 히어리스틱은 최적해가 아니어도 유효할 수 있습니다.
Give the list $7, 3, 9, 1, 5$ after one pass of bubble sort (ascending).
난이도 1/5 · 100코인 + 오늘 첫 완료 시 작은 보너스 추가
Swap 7/3, keep 7/9, swap 9/1, swap 9/5: the largest moves to the end.
worked example
바구니 용량 10과 물품 6,5,4,3,2을 해당 순서로 할 때, first-fit는 6와 4를 바구니 1에, 이후 5,3,2를 바구니 2에 배치합니다. 총 2개의 바구니를 사용합니다. 총 크기는 20이므로 하한은 ceil(20/10)=2이며, 이 배치는 해당 인스턴스에 대해 최적입니다.
Sorting, packing and network algorithms
Trace the named algorithm exactly, including its tie rules
Compare the model with the worked case and explain one change.
Items total 47 kg and each bin holds 10 kg. Find the lower bound for the number of bins.
난이도 2/5 · 140코인 + 오늘 첫 완료 시 작은 보너스 추가
$\tfrac{47}{10} = 4.7$, rounded up to 5.
실수하는 지점
- 한 예시에서의 성공이 히어리스틱이 항상 최적임을 증명하지는 않습니다.
- 정렬 추적 시 중간 목록을 유지하십시오. 입력값에서 바로 최종 정렬된 목록으로 점프하지 마십시오.
- 경로 요청 시 최단 경로 업데이트는 전조자 정보를 유지해야 합니다.
옳지 않음: 한 예시에서 잘 작동하는 포장 히어리스틱이 반드시 최적이어야 한다는 주장은 틀렸습니다. 히어리스틱은 빠른 시간을 들여 좋은 해를 제공하지만, 모든 입력에 대해 최적임이 보장되지는 않습니다.
Pack $6, 5, 4, 4, 3, 3, 2, 2, 1$ into bins of size 12 using first fit decreasing. How many bins are used?
난이도 2/5 · 140코인 + 오늘 첫 완료 시 작은 보너스 추가
$[6, 5, 1]$, $[4, 4, 3]$, $[3, 2, 2]$ — 3 bins, equal to $\lceil 30/12 \rceil$.
적용하기
- 디스트라 알고리즘에서는 미처리 일러미네이트 tentative label 중 가장 작은 값을 선택하고 그 이웃을 업데이트하십시오.
- 경로 검사 문제에서는 폐경로와 개경로를 구분하고 짝수 정점을 찾기 전에 홀수 정점을 식별하십시오.
A network in which every vertex has even degree has a closed route that uses every edge exactly once.
난이도 1/5 · 100코인 + 오늘 첫 완료 시 작은 보너스 추가
Even degree everywhere means you can always leave a vertex you enter.
과정 내 내용
- Pearson Edexcel 국제 A-Level 수학, 단위 D1.
- 모든 시험지에 계산기가 허용되지만, 방법 점수는 여전히 값이 도출되기 전에 식이나 방정식을 작성해야 합니다.
- 알고리즘: 정의된 유형의 문제를 해결하기 위한 유한한 순서적 명령의 집합입니다.
- 명시된 알고리즘을 정확히 추적하되, 동점 처리 규칙을 포함하십시오.
- 성공 사례가 히어리스틱이 항상 최적임을 증명하지는 않음을 유의하십시오.
용량 3의 공간에서 쓰기
- 용량 8인 상자에 크기 3과 2인 물품이 들어갑니다.
- 남은 공간을 구하십시오.
A network has four odd vertices $P, Q, R, S$. Shortest paths: $PQ = 5$, $RS = 6$, $PR = 4$, $QS = 8$, $PS = 7$, $QR = 3$. Which pairing should be repeated?
난이도 1/5 · 100코인 + 오늘 첫 완료 시 작은 보너스 추가
Compare all three pairings: 11, 12 and 10. All four odd vertices must be paired.
이 카드는 새로 추가되어 번역이 준비될 때까지 영어로 표시됩니다.
Assuming the algorithm's answer is the best one. First fit and first fit decreasing are heuristic 启发式的: they give a good answer quickly, but not always the best. You can only call a packing optimal when it equals the lower bound or you show that no fewer bins can work.
First fit decreasing always gives the smallest possible number of bins.
난이도 1/5 · 100코인 + 오늘 첫 완료 시 작은 보너스 추가
It is a heuristic: good, but not guaranteed optimal.
이 카드는 새로 추가되어 번역이 준비될 때까지 영어로 표시됩니다.
Bubble sort swaps neighbours pass by pass; quick sort splits around a pivot. For bin packing, find the lower bound, then use first fit or first fit decreasing; a packing that meets the bound is optimal. For route inspection, pair the odd vertices and repeat the shortest paths between them.
Use quick sort, taking the middle item as pivot, to sort $8, 3, 6, 1, 9, 4, 7$ into ascending order. Show each pass.
Pivot, split, repeat.
어떤 문제가 있었나요? 사이트 팀만 이 내용을 볼 수 있습니다.