Search Results

Search found 7490 results on 300 pages for 'algorithm analysis'.

Page 13/300 | < Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >

  • Running time for Dijkstra's algorithm on a priority queue implemented by sorted list/array

    - by jay
    So I'm curious to know what the running time for the algorithm is on on priority queue implemented by a sorted list/array. I know for an unsorted list/array it is O((n^2+m)) where n is the number of vertices and m the number of edges. Thus that equates to O(n^2) time. But would it be faster if i used an sorted list/array...What would the running time be? I know extractmin would be constant time.

    Read the article

  • Saddle roof algorithm

    - by user115621
    Hello, I have map (openstreetmap project) with many buildings. Each building is a polygon. How can I make saddle roof parts polygons for every building outline? Algorithm should transform one polygon in 2D to set of polygons in 2D (or 3D). Reason for this transformation is visualization - better rendering isometric view. For example (shading isn't important): Thanks

    Read the article

  • Calculating length of objects in binary image - algorithm

    - by Jacek
    I need to calculate length of the object in a binary image (maximum distance between the pixels inside the object). As it is a binary image, so we might consider it a 2D array with values 0 (white) and 1 (black). The thing I need is a clever (and preferably simple) algorithm to perform this operation. Keep in mind there are many objects in the image. The image to clarify: Sample input image:

    Read the article

  • Algorithm for Fogbugz pricing scheme

    - by Anon1865
    Hi, I'm looking for an algorithm to calculate total cost of licenses purchased based on the "FogBugz for your server" pricing scheme (http://www.fogcreek.com/FogBugz/PriceList.html). Fogbugz pricing is: 1 License $299 5 License Pack $999 10 License Pack $1,899 20 License Pack $3,499 50 License Pack $7,999 If you ask a quote for let's say 136 licenses they calculate it as $22,694. How can I do this in C# or LINQ? Any help will be appreciated.

    Read the article

  • cool project to use a genetic algorithm for?

    - by Ryan
    I'm looking for a practical application to use a genetic algorithm for. Some things that have thought of are: Website interface optimization Vehicle optimization with a physics simulator Genetic programming Automatic test case generation But none have really popped out at me. So if you had some free time (a few months) to spend on a genetic algorithms project, what would you choose to tackle?

    Read the article

  • Archery game programming algorithm

    - by Ricky
    I need the algorithm to animate the arrow based on 2 parameters, angle while shooting and power while drawing the bow. Ive tried to use y=asinx but it works only when shooting in up direction. Doesnt work well while shooting with straight or down direction. Thanks.

    Read the article

  • Time complexity of a recursive algorithm

    - by Passonate Learner
    How can I calculate the time complexity of a recursive algorithm? pow1(x,n) if(n==0){ return 1 } else{ return x * pow1(x, n-1) } pow2(x,n) if(n==0){ return 1 } else if(n is odd integer){ p = pow2(x, (n-1)/2) return x * p * p } else if(n is even integer){ p = pow2(x, n/2) return p * p }

    Read the article

  • Justifying UIVIews on the iPhone: Algorithm Help

    - by coneybeare
    I have been messing around with a way to justify align a collection of UIView subclasses within a containing view. I am having a little bit of trouble with the algorithm and was hoping someone could help spot my errors. Here is pseudocode of where I am now: // 1 see how many items there are int count = [items count]; // 2 figure out how much white space is left in the containing view float whitespace = [containingView width] - [items totalWidth]; // 3 Figure out the extra left margin to be applied to items[1] through items[count-1] float margin = whitespace/(count-1); // 4 Figure out the size of every subcontainer if it was evenly split float subcontainerWidth = [containingView width]/count; // 5 Apply the margin, starting at the second item for (int i = 1; i < [items count]; i++) { UIView *item = [items objectAtIndex:i]; [item setLeftMargin:(margin + i*subcontainerWidth)]; } The items do not appear to be evenly spaced here. Not even close. Where am I going wrong? Here is a shot of this algorithm in action: EDIT: The code above is pseudocode. I added the actual code here but it might not make sense if you are not familiar with the three20 project. @implementation TTTabStrip (JustifiedBarCategory) - (CGSize)layoutTabs { CGSize size = [super layoutTabs]; CGPoint contentOffset = _scrollView.contentOffset; _scrollView.frame = self.bounds; _scrollView.contentSize = CGSizeMake(size.width + kTabMargin, self.height); CGFloat contentWidth = size.width + kTabMargin; if (contentWidth < _scrollView.size.width) { // do the justify logic // see how many items there are int count = [_tabViews count]; // 2 figure out how much white space is left float whitespace = _scrollView.size.width - contentWidth; // 3 increase the margin on those items somehow to reflect. it should be (whitespace) / count-1 float margin = whitespace/(count-1); // 4 figure out starting point float itemWidth = (_scrollView.size.width-kTabMargin)/count; // apply the margin for (int i = 1; i < [_tabViews count]; i++) { TTTab *tab = [_tabViews objectAtIndex:i]; [tab setLeft:(margin + i*itemWidth)]; } } else { // do the normal, scrollbar logic _scrollView.contentOffset = contentOffset; } return size; } @end

    Read the article

  • Algorithm to calculate the number of divisors of a given number

    - by sker
    What would be the most optimal algorithm (performance-wise) to calculate the number of divisors of a given number? It'll be great if you could provide pseudocode or a link to some example. EDIT: All the answers have been very helpful, thank you. I'm implementing the Sieve of Atkin and then I'm going to use something similar to what Jonathan Leffler indicated. The link posted by Justin Bozonier has further information on what I wanted.

    Read the article

  • A leader election algorithm for an oriented hypercube

    - by mick
    I'm stuck with some problem where I have to design a leader election algorithm for an oriented hypercube. This should be done by using a tournament with a number of rounds equal to the dimension D of the hypercube. In each stage d, with 1 <= d < D two candidate leaders of neighbouring d-dimensional hypercubes should compete to become the single candidate leader of the (d+1)-dimensional hypercube that is the union of their respective hypercubes.

    Read the article

  • Dijkstra shortest path algorithm with edge cost.

    - by Svisstack
    Hello, I have a directed, positive weighted graph. Each edge have a cost of use. I have only A money, i want to calculate shortest paths with dijkstra algorithm, but sum of edges costs on route must be less or equal to A. I want to do this with most smallest Dijstra modification (if I can do it with small modification of Dijkstra). Anyone can help me with this?

    Read the article

  • Fastest sorting algorithm for a specific situation

    - by luvieere
    What is the fastest sorting algorithm for a large number (tens of thousands) of groups of 9 positive double precision values, where each group must be sorted individually? So it's got to sort fast a small number of possibly repeated double precision values, many times in a row. The values are in the [0..1] interval. I don't care about space complexity or stability, just about speed.

    Read the article

  • Sort algorithm with fewest number of operations

    - by luvieere
    What is the sort algorithm with fewest number of operations? I need to implement it in HLSL as part of a pixel shader effect v2.0 for WPF, so it needs to have a really small number of operations, considering Pixel Shader's limitations. I need to sort 9 values, specifically the current pixel and its neighbors.

    Read the article

  • efficient algorithm for drawing circle arcs?

    - by banister
    I am using the mid-point circle algorithm (bresenham circle) to efficiently draw whole circles. Is there something similar to draw circle arcs? I would like to specify a start angle and end angle and have only that portion of the circle drawn. Thanks in advance! EDIT: I would like to draw filled circle arcs too, i.e pie-slices. :)

    Read the article

  • finding shortest valid path in a colored-edge graphs

    - by user1067083
    Given a directed graph G, with edges colored either green or purple, and a vertex S in G, I must find an algorithm that finds the shortest path from s to each vertex in G so the path includes at most two purple edges (and green as much as needed). I thought of BFS on G after removing all the purple edges, and for every vertex that the shortest path is still infinity, do something to try to find it, but I'm kinda stuck, and it takes alot of the running time as well... Any other suggestions? Thanks in advance

    Read the article

  • Parallel curve like algorithm for graphs

    - by skrat
    Is there a well know algorithm for calculating "parallel graph"? where by parallel graph I mean the same as parallel curve, vaguely called "offset curve", but with a graph instead of a curve. Given this picture how can I calculate points of black outlined polygons?

    Read the article

  • Algorithm for best positioning objects on a Visio model

    - by leandrosa81
    Hello, I am trying to map all network devices and create a visio file with the resulting network topology. I was wondering if there are any algorithm for best positioning the nodes on the graph, considering its connections. Connections are bidirectional, like this (may have many connections between the same nodes): --------- --------- | | | | | A |----------| B | |_______| |_______|

    Read the article

  • Good Java graph algorithm library?

    - by Nick Fortescue
    Has anyone had good experiences with any Java libraries for Graph algorithms. I've tried JGraph and found it ok, and there are a lot of different ones in google. Are there any that people are actually using successfully in production code or would recommend? To clarify, I'm not looking for a library that produces graphs/charts, I'm looking for one that helps with Graph algorithms, eg minimum spanning tree, Kruskal's algorithm Nodes, Edges, etc. Ideally one with some good algorithms/data structures in a nice Java OO API.

    Read the article

< Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >