id
int64
0
25.6k
text
stringlengths
0
4.59k
23,700
graph algorithms simple maximum-flow algorithm first attempt to solve the problem proceeds in stages we start with our graphgand construct flow graph gf gf tells the flow that has been attained at any stage in the algorithm initially all edges in gf have no flowand we hope that when the algorithm terminatesgf contains ...
23,701
figure ggf gr after two units of flow added along sbdt figure ggf gr after two units of flow added along sact figure ggf gr after one unit of flow added along sadt--algorithm terminates
23,702
graph algorithms figure ggf gr if initial action is to add three units of flow along sadt--algorithm terminates after one more step with suboptimal solution failed to find an optimal solution this is an example of greedy algorithm that does not work figure shows why the algorithm fails in order to make this algorithm w...
23,703
figure graphs after two units of flow added along sbdact using correct algorithm there is no augmenting path in this graphso the algorithm terminates note that the same result would occur if at figure the augmenting path sact was chosen which allows one unit of flowbecause then subsequent augmenting path could be found...
23,704
graph algorithms figure the classic bad case for augmenting is no guarantee that this will be efficient in particularif the capacities are all integers and the maximum flow is fthensince each augmenting path increases the flow value by at least stages sufficeand the total running time is ( *| |)since an augmenting path...
23,705
the residual graphand edge (vuwas added (uvcannot reappear in the residual graph againunless and until (vuappears in future augmenting path but if it doesthen the distance to at that point must be dv which would be higher than at the time (uvwas previously removed this means that each time (uvreappearsu' distance goes ...
23,706
graph algorithms figure graph and its minimum spanning tree prim' algorithm one way to compute minimum spanning tree is to grow the tree in successive stages in each stageone node is picked as the rootand we add an edgeand thus an associated vertexto the tree at any point in the algorithmwe can see that we have set of ...
23,707
figure prim' algorithm after each stage known dv pv figure initial configuration of table used in prim' algorithm known dv pv figure the table after is declared known
23,708
graph algorithms known dv pv figure the table after is declared known selected is every vertex is adjacent to is not examinedbecause it is known is unchangedbecause it has dv and the edge cost from to is all the rest are updated figure shows the resulting table the next vertex chosen is (arbitrarily breaking tiethis do...
23,709
known dv pv figure the table after and are selected (prim' algorithm terminatesthe final table is shown in figure the edges in the spanning tree can be read from the table( )( )( )( )( )( the total cost is the entire implementation of this algorithm is virtually identical to that of dijkstra' algorithmand everything th...
23,710
graph algorithms figure kruskal' algorithm after each stage formallykruskal' algorithm maintains forest-- collection of trees initiallythere are |vsingle-node trees adding an edge merges two trees into one when the algorithm terminatesthere is only one treeand this is the minimum spanning tree figure shows the order in...
23,711
vector kruskalvector edgesint numvertices disjsets dsnumvertices }priority_queue pqedges }vector mstwhilemst size!numvertices edge pq pop)/edge (uvsettype uset ds finde getu)settype vset ds finde getv)ifuset !vset /accept the edge mst push_backe )ds unionusetvset )return mstfigure pseudocode for kruskal' algorithm actu...
23,712
graph algorithms void graph::dfsvertex visited truefor each vertex adjacent to if! visited dfsw )figure template for depth-first search (pseudocodeapply depth-first traversal thereand continue this process until there are no unmarked nodes because this strategy guarantees that each edge is encountered only oncethe tota...
23,713
figure an undirected graph figure depth-first search of previous graph biconnectivity connected undirected graph is biconnected if there are no vertices whose removal disconnects the rest of the graph the graph in figure is biconnected if the nodes are computers and the edges are linksthen if any computer goes downnetw...
23,714
graph algorithms figure graph with articulation points and unaffectedexceptof courseat the down computer similarlyif mass transit system is biconnectedusers always have an alternate route should some terminal be disrupted if graph is not biconnectedthe vertices whose removal would disconnect the graph are known as arti...
23,715
/ / / / / / / figure depth-first tree for previous graphwith num and low back edge this third method is succinctly described with recursive call since we need to evaluate low for all the children of before we can evaluate low( )this is postorder traversal for any edge (vw)we can tell whether it is tree edge or back edg...
23,716
graph algorithms / / / / / / / figure depth-first tree that results if depth-first search starts at we close by giving pseudocode to implement this algorithm we will assume that vertex contains the data members visited (initialized to false)numlowand parent we will also keep (graphclass variable called counterwhich is ...
23,717
/*assign lowalso check for articulation points *void graph::assignlowvertex low num/rule for each vertex adjacent to ifw num num /forward edge assignloww )ifw low > num cout < <is an articulation point<endlv low minv loww low )/rule else ifv parent ! /back edge low minv loww num )/rule figure pseudocode to compute low ...
23,718
visited truev low num counter++/rule for each vertex adjacent to if! visited /forward edge parent vfindartw )ifw low > num cout < <is an articulation point<endlv low minv loww low )/rule else ifv parent ! /back edge low minv loww num )/rule figure testing for articulation points in one depth-first search (test for the ...
23,719
after this conversion is performedwe must find path in the graph that visits every edge exactly once if we are to solve the "extra challenge,then we must find cycle that visits every edge exactly once this graph problem was solved in by euler and marked the beginning of graph theory the problem is thus commonly referre...
23,720
graph algorithms figure graph for euler circuit problem figure graph remaining after figure graph after the path current patha circuit of is obtained as all the edges are traversedthe algorithm terminates with an euler circuit to make this algorithm efficientwe must use appropriate data structures we will sketch some o...
23,721
figure graph remaining after the path the total work performed on the vertex search phase is (| |during the entire life of the algorithm with the appropriate data structuresthe running time of the algorithm is (| | | very similar problem is to find simple cyclein an undirected graphthat visits every vertex this is know...
23,722
graph algorithms figure directed graph figure depth-first search of previous graph one use of depth-first search is to test whether or not directed graph is acyclic the rule is that directed graph is acyclic if and only if it has no back edges (the graph above has back edgesand thus is not acyclic the reader may rememb...
23,723
finding strong components by performing two depth-first searcheswe can test whether directed graph is strongly connectedand if it is notwe can actually produce the subsets of vertices that are strongly connected to themselves this can also be done in only one depth-first searchbut the method used here is much simpler t...
23,724
graph algorithms figure depth-first search of gr --strong components are { }{hij}{bacf}{ }{eto prove that this algorithm workswe must show that if two vertices and are in the same depth-first spanning tree of gr there must be paths from to and from to equivalentlywe can show that if is the root of the depth-first spann...
23,725
in this section we will take brief look at this problem this topic is rather complexso we will only take quick and informal look at it because of thisthe discussion may be (necessarilysomewhat imprecise in places we will see that there are host of important problems that are roughly equivalent in complexity these probl...
23,726
graph algorithms and we arrive at the same set of contradictions thuswe see that the program loop cannot possibly exist the class np few steps down from the horrors of undecidable problems lies the class np np stands for nondeterministic polynomial-time deterministic machineat each point in timeis executing an instruct...
23,727
problemp can be reduced to as followsprovide mapping so that any instance of can be transformed to an instance of solve and then map the answer back to the original as an examplenumbers are entered into pocket calculator in decimal the decimal numbers are converted to binaryand all calculations are performed in binary ...
23,728
graph algorithms figure hamiltonian cycle problem transformed to traveling salesman problem problems are considered before the problem that actually provides the reduction as we are only interested in the general ideaswe will not show any more transformationsthe interested reader can consult the references the alert re...
23,729
summary in this we have seen how graphs can be used to model many real-life problems many of the graphs that occur are typically very sparseso it is important to pay attention to the data structures that are used to implement them we have also seen class of problems that do not seem to have efficient solutions in some ...
23,730
graph algorithms figure graph used in exercise suppose all the edge weights in graph are integers between and |ehow fast can dijkstra' algorithm be implementedwrite program to solve the single-source shortest-path problem explain how to modify dijkstra' algorithm to produce count of the number of different minimum path...
23,731
figure bipartite graph give an algorithm to find an augmenting path that permits the maximum flow let be the amount of flow remaining in the residual graph show that the augmenting path produced by the algorithm in part (aadmits path of capacity /|ec show that after |econsecutive iterationsthe total flow remaining in t...
23,732
graph algorithms figure graph used in exercise give an algorithm to find maximum spanning tree is this harder than finding minimum spanning treefind all the articulation points in the graph in figure show the depth-first spanning tree and the values of num and low for each vertex prove that the algorithm to find articu...
23,733
write program to find the strongly connected components in digraph give an algorithm that finds the strongly connected components in only one depthfirst search use an algorithm similar to the biconnectivity algorithm the biconnected components of graphgis partition of the edges into sets such that the graph formed by e...
23,734
graph algorithms multigraph is graph in which multiple edges are allowed between pairs of vertices which of the algorithms in this work without modification for multigraphswhat modifications need to be done for the others let (vebe an undirected graph use depth-first search to design linear algorithm to convert each ed...
23,735
figure grid for exercise write program that computes enough information to output path in the maze give output in the form sen (representing go souththen eastthen northetc if you are using +compiler with windowing packagewrite program that draws the maze andat the press of buttondraws the path suppose that walls in the...
23,736
graph algorithms that any team is better than any other for instancein the six-team league where everyone plays three gamessuppose we have the following resultsa beat and cb beat and fc beat dd beat ee beat af beat and then we can prove that is better than fbecause beat bwho in turnbeat similarlywe can prove that is be...
23,737
references good graph theory textbooks include [ ][ ][ ]and [ more advanced topicsincluding the more careful attention to running timesare covered in [ ][ ]and [ use of adjacency lists was advocated in [ the topological sort algorithm is from [ ]as described in [ dijkstra' algorithm appeared in [ the improvements using...
23,738
graph algorithms chazelle" minimum spanning tree algorithm with inverse-ackermann type complexity,journal of the acm ( ) - cheriton and tarjan"finding minimum spanning trees,siam journal on computing ( ) - cheriyan and hagerup" randomized maximum-flow algorithm,siam journal on computing ( ) - cook"the complexity of the...
23,739
hopcroft and tarjan"dividing graph into triconnected components,siam journal on computing ( ) - hopcroft and tarjan"efficient planarity testing,journal of the acm ( ) - hopcroft and wong"linear-time algorithm for isomorphism of planar graphs,proceedings of the sixth annual acm symposium on theory of computing ( ) - joh...
23,740
graph algorithms tarjan"testing flow graph reducibility,journal of computer and system sciences ( ) - tarjan"finding dominators in directed graphs,siam journal on computing ( ) - tarjan"complexity of combinatorial algorithms,siam review ( ) - tarjandata structures and network algorithmssociety for industrial and applie...
23,741
algorithm design techniques so farwe have been concerned with the efficient implementation of algorithms we have seen that when an algorithm is giventhe actual data structures need not be specified it is up to the programmer to choose the appropriate data structure in order to make the running time as small as possible...
23,742
algorithm design techniques denomination thusto give out seventeen dollars and sixty-one cents in changewe give out ten-dollar billa five-dollar billtwo one-dollar billstwo quartersone dimeand one penny by doing thiswe are guaranteed to minimize the number of bills and coins this algorithm does not work in all monetary...
23,743
figure schedule # (optimal(time units) in in and in the average completion time is better schedulewhich yields mean completion time of is shown in figure the schedule given in figure is arranged by shortest job first we can show that this will always yield an optimal schedule let the jobs in the schedule be ji ji jin t...
23,744
time figure jobs and times figure an optimal solution for the multiprocessor case figure second optimal solution for the multiprocessor case
23,745
minimizing the final completion time we close this section by considering very similar problem suppose we are only concerned with when the last job finishes in our two examples abovethese completion times are and respectively figure shows that the minimum final completion time is and this clearly cannot be improvedbeca...
23,746
algorithm design techniques character code frequency total bits space newline total figure using standard coding scheme the case where we are transmitting it over slow phone line alsosince on virtually every machinedisk space is preciousone might wonder if it would be possible to provide better code and reduce the tota...
23,747
nl sp figure slightly better tree notice that the tree in figure is full treeall nodes either are leaves or have two children an optimal code will always have this propertysince otherwiseas we have already seennodes with only one child could move up level if the characters are placed only at the leavesany sequence of b...
23,748
algorithm design techniques character code frequency total bits space newline total figure optimal prefix code huffman' algorithm throughout this section we will assume that the number of characters is huffman' algorithm can be described as followswe maintain forest of trees the weight of tree is equal to the sum of th...
23,749
sp nl figure huffman' algorithm after the second merge sp nl figure huffman' algorithm after the third merge this is shown in figure the third step merges and acreating with weight figure shows the result of this operation after the third merge is completedthe two trees of lowest weight are the single-node trees repres...
23,750
algorithm design techniques sp nl figure huffman' algorithm after the fifth merge nextwe must show that the two least frequent characters and must be the two deepest nodes (although other nodes may be as deepagainthis is easy to show by contradictionsince if either or is not deepest nodethen there must be some that is ...
23,751
on priority queue that never has more than elements simple implementation of the priority queueusing listwould give an ( algorithm the choice of priority queue implementation depends on how large is in the typical case of an ascii character setc is small enough that the quadratic running time is acceptable in such an a...
23,752
algorithm design techniques online algorithms the first issue to consider is whether or not an online algorithm can actually always give an optimal answereven if it is allowed unlimited computation remember that even though unlimited computation is allowedan online algorithm must place an item before processing the nex...
23,753
next fit probably the simplest algorithm is next fit when processing any itemwe check to see whether it fits in the same bin as the last item if it doesit is placed thereotherwisea new bin is created this algorithm is incredibly simple to implement and runs in linear time figure shows the packing produced for the same ...
23,754
/ / / / / / bn/ bn/ + figure optimal packing for / / /nempty empty empty / / bn/ figure next fit packing for / / /nempty empty empty empty figure first fit for /
23,755
simple method of implementing first fit would process each item by scanning down the list of bins sequentially this would take ( it is possible to implement first fit to run in ( log )we leave this as an exercise moment' thought will convince you that at any pointat most one bin can be more than half emptysince if seco...
23,756
algorithm design techniques empty empty empty figure best fit for notice that the item of size is placed in where it fits perfectlyinstead of one might expect that since we are now making more educated choice of binsthe performance guarantee would improve this is not the casebecause the generic bad cases are the same b...
23,757
shows that in our case this yields an optimal solution (althoughof coursethis is not true in generalin this sectionwe will deal with first fit decreasing the results for best fit decreasing are almost identical since it is possible that the item sizes are not distinctsome authors prefer to call the algorithm first fit ...
23,758
algorithm design techniques some set of binsand from previous considerationsthe total number of such items is ( the proof is completed by noting that if si there is no way for si to be placed in one of these bins clearlyit cannot go in one of the binssince if it couldthen first fit would have done so too to place it in...
23,759
optimal first fit decreasing / / empty empty / / / / / / / / / / / / / / / / / / - empty / figure example where first fit decreasing uses binsbut only bins are required theorem let be the optimal number of bins required to pack list of items then first fit decreasing never uses more than bins there exist sequences such...
23,760
algorithm design techniques are not we generally insist that the subproblems be disjoint (that isessentially nonoverlappinglet us review some of the recursive algorithms that have been covered in this text we have already seen several divide-and-conquer algorithms in section we saw an ( log nsolution to the maximum sub...
23,761
theorem the solution to the equation (nat( / (nk )where > and is log if bk ( (no(nk log nif bk (nk if bk proof following the analysis of mergesort in we will assume that is power of bthuslet bm then / bm- and nk (bm ) bmk bkm (bk ) let us assume ( and ignore the constant factor in (nk then we have (bm at(bm- (bk ) if...
23,762
algorithm design techniques if bk then the sum is geometric series with ratio smaller than since the sum of infinite series would converge to constantthis finite sum is also bounded by constantand thus equation ( appliest(no(am (alogb (nlogb ( if bk then each term in the sum is since the sum contains logb terms and bk ...
23,763
we are required to find the closest pair of points it is possible that two points have the same positionin that casethat pair is the closestwith distance zero if there are pointsthen there are ( )/ pairs of distances we can check all of theseobtaining very short programbut at the expense of an ( algorithm since this ap...
23,764
algorithm design techniques dc dl dr figure partitioned into pl and pr shortest distances are shown in figure implements this strategyassuming the +convention that the points are indexed starting at in the worst caseall the points could be in the stripso this strategy does not always work in linear time we can improve ...
23,765
/points are all in the strip fori numpointsinstripi+forj numpointsinstripj+ifdist(pi pj dist(pi pj )figure brute-force calculation of min(ddc /points are all in the strip and sorted by -coordinate fori numpointsinstripi+forj numpointsinstripj+ifpi and pj ' -coordinates differ by more than break/go to next pi else ifdis...
23,766
algorithm design techniques in the worst casefor any point pi at most points pj are considered this is because these points must lie either in the -by- square in the left half of the strip or in the -by- square in the right half of the strip on the other handall the points in each -by- square are separated by at least ...
23,767
contains only points in the stripand these points are guaranteed to be sorted by their coordinates this strategy ensures that the entire algorithm is ( log )because only (nextra work is performed the selection problem the selection problem requires us to find the kth smallest element in collection of elements of partic...
23,768
algorithm design techniques the basic pivot selection algorithm is as follows arrange the elements into / groups of five elementsignoring the (at most fourextra elements find the median of each group this gives list of / medians find the median of return this as the pivotv we will use the term median-of-median-of-five ...
23,769
elements in the group we will let represent the huge elements these are elements that are known to be larger than large median similarlyt represents the tiny elementswhich are smaller than small median there are elements of type htwo are in each of the groups with an type medianand two elements are in the same group as...
23,770
algorithm design techniques more generallya samplesof elements is chosen from the elements let be some numberwhich we will choose later so as to minimize the average number of comparisons used by the procedure we find the ( ks/ )th and ( ks/ )th smallest elements in salmost certainlythe kth smallest element in will fal...
23,771
respectively then xl , xr , yl , and yr , we also have xl xr and yl yr it follows that xy xl yl (xl yr xr yl ) xr yr notice that this equation consists of four multiplicationsxl yl xl yr xr yl and xr yr which are each half the size of the original problem ( / digitsthe multiplications by and amount to the placing of ze...
23,772
algorithm design techniques it is easy to see that now the recurrence equation satisfies ( ( / (nand so we obtain (no(nlog ( to complete the algorithmwe must have base casewhich can be solved without recursion when both numbers are one-digitwe can do the multiplication by table lookup if one number has zero digitsthen ...
23,773
, , , , ' , , , , , , , , figure decomposing ab into four quadrants for long time it was assumed that ( was required for matrix multiplication howeverin the late sixtiesstrassen showed how to break the ( barrier the basic idea of strassen' algorithm is to divide each matrix into four quadrantsas shown in figure then it...
23,774
algorithm design techniques ( , , )( , , ( , , )( , , ( , , )( , , ( , , ) , , ( , , , ( , , ( , , ) , once the multiplications are performedthe final answer can be obtained with eight more additions , , , , it is straightforward to verify that this tricky ordering produces the desired values the running time now satis...
23,775
using table instead of recursion in we saw that the natural recursive program to compute the fibonacci numbers is very inefficient recall that the program shown in figure has running timet( )that satisfies ( > ( ( since (nsatisfies the same recurrence relation as the fibonacci numbers and has the same initial condition...
23,776
algorithm design techniques the reason that the recursive algorithm is so slow is because of the algorithm used to simulate recursion to compute fn there is one call to fn- and fn- howeversince fn- recursively makes call to fn- and fn- there are actually two separate calls to compute fn- if one traces out the entire al...
23,777
figure trace of the recursive calculation in eval double evalint vector cn ) forint < ++ double sum forint ++ sum +cj ]ci sum ireturn cn ]figure evaluating ( /  - = (in with table by using tablewe obtain the program in figure this program avoids the redundant recursive calls and runs in ( it is not perfect programas a...
23,778
algorithm design techniques algorithm such as strassen' algorithm does not significantly alter the problem we will considerso we will assume this performance bound what is the best way to perform the three matrix multiplications required to compute abcdin the case of four matricesit is simple to solve the problem by ex...
23,779
the solution of this recurrence is the well-known catalan numberswhich grow exponentially thusfor large nan exhaustive search through all possible orderings is useless neverthelessthis counting argument provides basis for solution that is substantially better than exponential let ci be the number of columns in matrix a...
23,780
algorithm design techniques /*compute optimal ordering of matrix multiplication contains the number of columns for each of the matrices is the number of rows in matrix the minimum number of multiplications is left in ] actual ordering is computed via another procedure using lastchange and lastchange are indexed startin...
23,781
word probability am and egg if the two figure sample input for optimal binary search tree problem if egg two and am and am the the and if two if am egg two egg the figure three possible binary search trees for data in previous table the first tree was formed using greedy strategy the word with the highest probability o...
23,782
algorithm design techniques is optimalas demonstrated by the existence of the third tree from this we can see that neither of the obvious solutions works this is initially surprisingsince the problem appears to be very similar to the construction of huffman encoding treewhichas we have already seencan be solved by gree...
23,783
left= left= left= am am and and iteration= am and am and and egg am iteration= and and and if am egg and iteration= am and if am if and the egg iteration= am and if am the and two if iteration= and and if am two the iteration= and and two iteration= and left= left= if if egg egg egg if if the egg if if if egg the if tw...
23,784
algorithm design techniques and am (nulland if am am egg if egg if am and if if am egg (null figure computation of table entry ( andfor am if performs correctly if there are negative edge costs but no negative-cost cyclesdijkstra' algorithm fails in this case let us recall the important details of dijkstra' algorithm (...
23,785
/*compute all-shortest paths contains the adjacency matrix with ai ] presumed to be zero contains the values of the shortest path vertices are numbered starting at all arrays have equal dimension negative cycle exists if di ] is set to negative value actual path can be computed using path]not_a_vertex is - *void allpai...
23,786
algorithm design techniques on complete graphwhere every pair of vertices is connected (in both directions)this algorithm is almost certain to be faster than |viterations of dijkstra' algorithmbecause the loops are so tight lines to can be executed in parallelas can lines to thusthis algorithm seems to be well suited f...
23,787
the worst-case running time of randomized algorithm is often the same as the worstcase running time of the nonrandomized algorithm the important difference is that good randomized algorithm has no bad inputs but only bad random numbers (relative to the particular inputthis may seem like only philosophical differencebut...
23,788
algorithm design techniques suppose we only need to flip cointhuswe must generate (for headsor (for tailsrandomly one way to do this is to examine the system clock the clock might record time as an integer that counts the number of seconds since some starting time we could then use the lowest bit the problem is that th...
23,789
numbersit is probably best to set so that the same random sequence occurs all the time when the program seems to workeither the system clock can be used or the user can be asked to input value for the seed it is also common to return random real number in the open interval ( ( and are not possible values)this can be do...
23,790
static const int static const int class random publicexplicit randomint initialvalue )int randomint)double random )int randomintint lowint high )privateint state}/*construct with initialvalue for the state *random::randomint initialvalue ifinitialvalue initialvalue +mstate initialvalueifstate = state /*return pseudoran...
23,791
static const int static const int static const int astatic const int /*return pseudorandom intand change the internal state *int random::randomintint tmpstate state state )iftmpstate > state tmpstateelse state tmpstate mreturn statefigure random-number modification that does not overflow on -bit machines xi+ (axi cmod ...
23,792
algorithm design techniques along with this typedef that yields the random-number generator (the "minimal standard"described earliertypedef linear congruential engine minstd rand the library also provides generator based on newer algorithmknown as the mersenne twisterwhose description is beyond the scope of the bookalo...
23,793
#include #include #include using namespace stdclass uniformrandom publicuniformrandomint seed currenttimesecondsgeneratorseed /return pseudorandom int int nextintstatic uniform_int_distribution distributionreturn distributiongenerator)/return pseudorandom int in range [ highint nextintint high return nextint high )/ret...
23,794
algorithm design techniques figure simple linked list figure linked list with links to two cells ahead figure linked list with links to four cells ahead figure linked list with links to cells ahead accordance with this probability distribution the easiest way to do this is to flip coin until head occurs and use the tot...
23,795
figure before and after an insertion proceed as in searchand keep track of each point where we switch to lower level the new nodewhose level is determined randomlyis then spliced into the list this operation is shown in figure cursory analysis shows that since the expected number of nodes at each level is unchanged fro...
23,796
algorithm design techniques by the algorithm thusthis algorithm occasionally makes mistakebut we will see that the error ratio can be made arbitrarily negligible the key to the algorithm is well-known theorem due to fermat theorem (fermat' lesser theoremif is primeand pthen ap- (mod pproof proof of this theorem can be ...
23,797
/*function that implements the basic primality test if witness does not return is definitely composite do this by computing (mod nand looking for non-trivial square roots of along the way *hugeint witnessconst hugeint aconst hugeint iconst hugeint ifi = return hugeint witnessai )ifx = /if is recursively compositestop r...
23,798
algorithm design techniques / - this is actually very conservative estimatewhich holds for only few choices of even soone is more likely to see hardware error than an incorrect claim of primality randomized algorithms for primality testing are important because they have long been significantly faster than the best non...
23,799
every pair of points of the form |xi xj ( jit is clear that if we are given the set of pointsit is easy to construct the set of distances in ( time this set will not be sortedbut if we are willing to settle for an ( log ntime boundthe distances can be sortedtoo the turnpike reconstruction problem is to reconstruct poi...