15.082 and 6.855J February 25, 2003 - PowerPoint PPT Presentation

About This Presentation
Title:

15.082 and 6.855J February 25, 2003

Description:

15.082 and 6.855J February 25, 2003 Radix Heap Animation – PowerPoint PPT presentation

Number of Views:71
Avg rating:3.0/5.0
Slides: 21
Provided by: JimO167
Learn more at: http://dspace.mit.edu
Category:
Tags: 855j | february | heap

less

Transcript and Presenter's Notes

Title: 15.082 and 6.855J February 25, 2003


1
15.082 and 6.855J February 25, 2003
  • Radix Heap Animation

2
An Example from AMO (with a small change)
Initialize distance labels
Initialize buckets and their ranges.
Insert nodes into buckets.
2 3
47
8 15
16 31
3263
2
0
1
3
4
5
1
6
3
Select
?
?
5
Select the node with minimum distance label
2
4
15
2
13
?
0
1
6
1
20
0
8
9
5
3
?
?
2 3
47
8 15
16 31
3263
2
0
1
3
4
5
1
6
4
Update
13
15
5
Scan arcs out of node 1 and update distance
labels.
2
4
15
2
13
1
6
1
20
0
8
9
5
3
0
20
2 3
47
8 15
16 31
3263
2
0
1
3
4
2
5
5
3
4
6
5
Select
13
15
5
Select the node with minimum distance label
2
4
15
2
13
?
0
1
6
1
Node 3 has label 0, which is minimum.
20
0
8
9
5
3
3
0
20
2 3
47
8 15
16 31
3263
0
1
6
2
5
3
4
6
Update
13
15
5
Scan arcs out of node 3 and update distance
labels.
2
4
15
2
13
?
0
1
6
1
20
0
8
9
5
3
3
0
20
9
2 3
47
8 15
16 31
3263
0
1
6
2
5
3
4
5
7
Select part 1
13
15
5
Find the first non-empty bucket, by scanning
buckets from left to right.
2
4
15
2
13
?
0
1
6
1
20
0
8
9
5
3
3
0
20
9
2 3
47
8 15
16 31
3263
0
1
6
2
4
5
8
Select part 2
13
15
5
Determine the minimum distance value in the
bucket, by scanning all nodes in the bucket.
2
4
15
2
13
?
0
1
6
1
20
0
8
9
5
3
3
0
d(5) 9, which is minimum.
20
9
2 3
47
8 15
16 31
3263
0
1
6
2
4
5
9
Select part 3
13
15
5
Redistribute the range of bucket 5 into the first
4 buckets, starting with value 9. Bucket widths
stay the same, except that some may be smaller.
2
4
15
2
13
?
0
1
6
1
20
0
8
9
5
3
3
0
20
9
11 12
1315
2 3
8 15
16 31
3263
?
47
0
1
9
10
6
2
4
5
10
Select part 4
13
15
5
Reinsert nodes in the correct bucket. Determine
the bucket by scanning left.
2
4
15
2
13
?
0
1
6
1
20
0
8
9
At this point the leftmost bucket is non-empty
5
3
3
0
20
9
2 3
1315
8 15
16 31
3263
11 12
?
0
1
9
10
6
2
2
5
4
4
5
11
Select part 5
13
15
5
Select a node in the leftmost bucket.
2
4
15
2
13
?
0
1
6
1
20
0
8
9
5
3
3
5
0
20
9
2 3
1315
8 15
16 31
3263
11 12
?
0
1
9
10
6
2
5
4
12
Update
13
15
5
Scan arcs out of node 5 and update distance
labels.
2
4
15
2
13
?
0
17
1
6
1
Reinsert nodes in correct buckets by scanning
left.
20
0
8
9
5
3
3
5
0
20
9
2 3
1315
8 15
16 31
3263
11 12
?
0
1
9
10
6
2
6
4
13
Select parts 1 and 2
13
15
5
Find the minimum non-empty bucket.
2
4
15
2
13
?
0
17
1
6
1
Find the minimum distance label in the bucket
20
0
8
9
5
3
3
5
0
20
9
2 3
1315
8 15
16 31
3263
11 12
?
0
1
9
10
2
6
4
14
Select parts 3 and 4
13
15
5
Redistribute bucket ranges in the minimum bucket
2
4
15
2
13
?
0
17
1
6
1
Reinsert nodes in correct buckets.
20
0
8
9
5
3
3
5
0
20
9
2 3
1315
8 15
16 31
3263
11 12
?
?
15
0
1
9
10
13
14
2
6
2
4
4
15
Select part 5
13
15
5
Select a node from the leftmost bucket.
2
4
2
15
2
13
?
0
17
1
6
1
20
0
8
9
5
3
3
5
0
20
9
2 3
1315
8 15
16 31
3263
11 12
?
?
15
0
1
9
10
13
14
6
2
4
16
Update
13
15
5
Scan the arc out of node 2.
2
4
2
15
2
13
?
0
17
1
6
1
20
0
8
9
5
3
3
5
0
20
9
2 3
1315
8 15
16 31
3263
11 12
?
?
15
0
1
9
10
13
14
6
4
17
Select, Modified rule 1
13
15
5
Find the minimum non-empty bucket
2
4
2
4
15
2
13
?
0
17
If the bucket has a width of 1, select any node
in the bucket.
1
6
1
20
0
8
9
5
3
3
5
0
20
9
2 3
1315
8 15
16 31
3263
11 12
?
?
15
0
1
9
10
13
14
6
4
18
Update
13
15
5
Scan the arc out of node 4
2
4
2
4
15
2
13
?
0
17
1
6
1
20
0
8
9
5
3
3
5
0
20
9
2 3
1315
8 15
16 31
3263
11 12
?
?
15
0
1
9
10
13
14
6
19
Select modified rule 2
13
15
5
Find the minimum non-empty bucket
2
4
2
4
15
2
13
?
0
17
If the bucket has a single node, then select the
node.
1
6
1
6
20
0
Modified rules and heuristics often help in
practice, but must be used carefully.
8
9
5
3
3
5
0
20
9
2 3
1315
8 15
16 31
3263
11 12
?
?
15
0
1
9
10
13
14
6
20
The algorithm ends
13
15
5
There are no arcs to update.
2
4
2
4
15
2
13
?
0
17
1
6
1
6
There are no nodes that need to be permanently
labeled.
20
0
8
9
5
3
3
5
0
20
9
2 3
1315
8 15
16 31
3263
11 12
?
?
15
0
1
9
10
13
14
Write a Comment
User Comments (0)
About PowerShow.com