没有合适的资源?快使用搜索试试~ 我知道了~
首页Algorithm Design: Parallel and Sequential
资源详情
资源评论
资源推荐
Algorithm Design: Parallel and Sequential
Umut A. Acar || Guy E. Blelloch
September 2017
2
c
2016 Umut A. Acar and Guy E. Blelloch
All rights reserved. This book or any portion thereof may not be reproduced or used in any
manner whatsoever without the express written permission of the copyright holders (authors)
except for the use of brief quotations in a book review.
Umut A. Acar
Carnegie Mellon University
Department of Computer Science GHC 9231
Pittsburgh PA 15213 USA
Guy E. Blelloch
Carnegie Mellon University
Department of Computer Science GHC 9211
Pittsburgh PA 15213 USA
August 30, 2017 (DRAFT, PPAP)
Contents
I Introduction and Preliminaries 1
1 Introduction 3
1.1 Parallelism . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2 Work and Span . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.3 Specification, Problem, Implementation . . . . . . . . . . . . . . . . . . . . . . . . 9
1.4 Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2 Mathematical Preliminaries 15
2.1 Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.2 Relations and Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.3 Graph Theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.3.1 Basic Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.3.2 Weighted Graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
2.3.3 Subgraphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
2.3.4 Connectivity and Connected Components . . . . . . . . . . . . . . . . . . 22
2.3.5 Graph Partition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
2.3.6 Trees . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
3
4 CONTENTS
3 SPARC: A Strict Language for Parallel Computing 27
3.1 Functional Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
3.2 The SPARC Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
3.2.1 Syntax and Semantics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
3.2.2 Type System of SPARC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
II Fundamentals 43
4 Algorithm Design and Analysis 45
4.1 Asymptotic Complexity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
4.2 Cost Models: Machine and Language Based . . . . . . . . . . . . . . . . . . . . . . 48
4.2.1 The RAM Model for Sequential Computation . . . . . . . . . . . . . . . . 50
4.2.2 The Parallel RAM Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
4.2.3 The Work-Span Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
4.2.4 Scheduling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
4.3 Design Techniques . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
4.3.1 Brute Force . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
4.3.2 Reduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
4.3.3 Inductive Techniques . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
4.3.4 Randomization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
4.4 Cost Analysis with Recurrences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
4.5 What makes a good solution? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
4.6 Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
5 Example: Genome Sequencing 75
August 30, 2017 (DRAFT, PPAP)
CONTENTS 5
5.1 The Shotgun Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
5.2 Defining the Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
5.3 Brute-Force Algorithm 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
5.4 Understanding the Structure of the Problem . . . . . . . . . . . . . . . . . . . . . . 79
5.5 Brute Force Algorithm 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
5.6 Reduction to the Traveling-Salesperson Problem . . . . . . . . . . . . . . . . . . . 83
5.7 Greedy Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
5.8 Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
6 Sequences 93
6.1 Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
6.2 The Sequence Abstract Data Type . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
6.3 Sequence Comprehensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
6.4 Cost Specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
6.4.1 Array Sequences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
6.4.2 Tree Sequences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
6.4.3 List Sequences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
6.5 An Example: Primes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
6.6 Single-Threaded Array Sequences . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
6.7 Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
7 Algorithm-Design Technique: Contraction 131
7.1 Example 1: Implementing Reduce with Contraction . . . . . . . . . . . . . . . . . 132
7.2 Example 2: Implementing Scan with Contraction . . . . . . . . . . . . . . . . . . . 133
7.3 Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
August 30, 2017 (DRAFT, PPAP)
剩余419页未读,继续阅读
郭大宝
- 粉丝: 0
- 资源: 6
上传资源 快速赚钱
- 我的内容管理 收起
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
会员权益专享
最新资源
- zigbee-cluster-library-specification
- JSBSim Reference Manual
- c++校园超市商品信息管理系统课程设计说明书(含源代码) (2).pdf
- 建筑供配电系统相关课件.pptx
- 企业管理规章制度及管理模式.doc
- vb打开摄像头.doc
- 云计算-可信计算中认证协议改进方案.pdf
- [详细完整版]单片机编程4.ppt
- c语言常用算法.pdf
- c++经典程序代码大全.pdf
- 单片机数字时钟资料.doc
- 11项目管理前沿1.0.pptx
- 基于ssm的“魅力”繁峙宣传网站的设计与实现论文.doc
- 智慧交通综合解决方案.pptx
- 建筑防潮设计-PowerPointPresentati.pptx
- SPC统计过程控制程序.pptx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0