Overview External"Memory Algorithms ParallelGraphAlgorithms - - PDF document

overview
SMART_READER_LITE
LIVE PREVIEW

Overview External"Memory Algorithms ParallelGraphAlgorithms - - PDF document

DepartmentofMathematics andComputerScience DepartmentofMathematics andComputerScience Overview External"Memory Algorithms ParallelGraphAlgorithms Application Algorithms External"Parallel


slide-1
SLIDE 1

Parallelism andVLSIGroup Prof.Dr.JörgKeller DepartmentofMathematics andComputerScience

External"Parallel GraphAlgorithms

Course 01727ParallelProgramming

DepartmentofMathematics andComputerScience

Overview

External"Memory Algorithms ParallelGraphAlgorithms Application Algorithms Summary

  • Parallelism andVLSIGroup

Prof.Dr.J.Keller DepartmentofMathematics andComputerScience

External-Memory Algorithms

External"memory alg =data set too largetoholdinmem Data onhard disk: bandwidth ok for few access patterns pagewise access latency high random access very slow Bestknown example: external sorting (mostly merge sort,mostly databases)

  • Parallelism andVLSIGroup

Prof.Dr.J.Keller DepartmentofMathematics andComputerScience

Parallel Graph Algorithms I

  • Graphrepresentation:

" explicit by adjacency list " implicit by oracle

  • Oracle:call black"box code with node xasparameter
  • btain f(x)suchthat (x,f(x))is edge
  • Advantageofexplicit representation:

graph can be changed,e.g.pointer jumping

  • Advantageofimplicit representation:

able tohandlereally largegraphs without ext.memory

  • Parallelism andVLSIGroup

Prof.Dr.J.Keller DepartmentofMathematics andComputerScience

Parallel Graph Algorithms II

  • Example:

given digraph Gwith outdegree 1by oracle compute strongly connected components (SCCs)

  • Two variants:

" indegree alsoexactly 1(know function fis bijective) " indegree may vary (know nothing about function f)

  • Parallelism andVLSIGroup

Prof.Dr.J.Keller DepartmentofMathematics andComputerScience

Application I

  • Consider finitestate machine accepting noinput

(except ininit phase)

  • Stategraph hasoutdegree exactly 1
  • Examples:

pseudo"random number generator stream cipher iterated blockcipher cryptographic hash chain

  • Parallelism andVLSIGroup

Prof.Dr.J.Keller

slide-2
SLIDE 2

DepartmentofMathematics andComputerScience

Application II

  • Oracle=code ofstate"transition function
  • Statespace typically large:264 atleast
  • Strongly connected components =cycles

cycle lengths important parameter wrt security

  • Parallelism andVLSIGroup

Prof.Dr.J.Keller DepartmentofMathematics andComputerScience

Application III

  • Parallelism andVLSIGroup

Prof.Dr.J.Keller DepartmentofMathematics andComputerScience

Algorithms I

  • Listranking asfirst excercise
  • Given:Listoflength ninarray succ[1:n]

endoflistpoints toitself

  • Wanted:for each listelement,distancetoendoflist
  • For(t=1;t<logn;t++)

doinparallelfor i=1..n{ dist[i]+=dist[succ[i]];succ[i]=succ[succ[i]]; }

  • Parallelism andVLSIGroup

Prof.Dr.J.Keller DepartmentofMathematics andComputerScience

Algorithms II

  • Pointerdoubling inexternal memory:
  • Storelistofedges (i,succ[i])twice onexternal memory
  • Sort one copy with i,one copy with succ[i]
  • Foreach i:

findpredecessor jin2ndcopy,succ[j]=i(possibly mult.) findsuccessor succ[i]in1stcopy write (j,succ[i])todisc

  • Iterate logntimes:O(n/p*(log(n))2)
  • Parallelism andVLSIGroup

Prof.Dr.J.Keller DepartmentofMathematics andComputerScience

Algorithms III

  • FindSCCs ofdeg1"graphgiven by oracle f

if each SCCcontains anode with property A

  • For(all nodes xwith property A){

follow path x,f(x),f(f(x))… till reach node ywith A write (x,y,distxy)todisk } do{ make copy ofedge listwith reversed edges; sort 1stcopy with x,sort 2ndcopy with y; for each (x,y)in1stcopy: write (x,y)todisk if (x,y‘)in2ndcopy }while(edges have been removed);

  • Parallelism andVLSIGroup

Prof.Dr.J.Keller DepartmentofMathematics andComputerScience

Algorithms IV

  • Algorithm „shaves“ leaves from graph
  • Mayiterate for long,expect distancetocycle O(sqrt(n))
  • Therefore:use either if known that graph is shallow
  • r use until size reduced that fits into main mem
  • Parallelism andVLSIGroup

Prof.Dr.J.Keller

slide-3
SLIDE 3

DepartmentofMathematics andComputerScience

Algorithms V

  • Findmost cycles (=SCCs)for deg1"graphwith bij.oracle f
  • Preprocessing:

define asmany random anchor nodes asfitonyour disks for(each anchor x){ follow path x,f(x),f(f(x)),… until reach other anchor y write todisk (x,y,distxy) }

  • Converts graph with oracle into smaller graph with

adjacency list contains only cycles with ≥1anchor

  • Parallelism andVLSIGroup

Prof.Dr.J.Keller DepartmentofMathematics andComputerScience

Algorithms VI

  • How todetect that node is anchor?

If assumed that deg1"graphis random: use deterministic anchors e.g.allwith 24zero bits If not:use additionally pseudorandom permutation pi where pi(x)andpi"1(x)can be computed fast

  • Why somany anchors that disks are needed?

Chanceofputting anchor onto small cycle increases Findmore cycles!

  • Parallelism andVLSIGroup

Prof.Dr.J.Keller DepartmentofMathematics andComputerScience

Algorithms VII

  • Compute cycles inanchor graph inseveral rounds
  • Each round:

load edges (x,y)from largest x,asfitinto main mem compact alledges with (y,…)alsoinmain mem

  • Remove references tothose edges inedges ondisk
  • Paralleltime:O((n/m)2/p)
  • Parallelism andVLSIGroup

Prof.Dr.J.Keller DepartmentofMathematics andComputerScience

Summary

  • Ext"mem algorithms gain importance:

largedata sets,complex memory hierarchies

  • Many ext"mem algorithms use sorting
  • Currently:some better algorithms for undirected graphs
  • Algorithms very complex
  • Parallelism andVLSIGroup

Prof.Dr.J.Keller