How to distribute points evenly on the surface of hyperspheres in higher dimensions?

Very interesting question. I wanted to implement this into mine 4D rendering engine as I was curious how would it look like but I was too lazy and incompetent to handle ND transcendent problems from the math side. Instead I come up with different solution to this problem. Its not a Fibonaci Latice !!! Instead … Read more

Standards for pseudo code? [closed]

I recommend looking at the “Introduction to Algorithms” book (by Cormen, Leiserson and Rivest). I’ve always found its pseudo-code description of algorithms very clear and consistent. An example: DIJKSTRA(G, w, s) 1 INITIALIZE-SINGLE-SOURCE(G, s) 2 S ← Ø 3 Q ← V[G] 4 while Q ≠ Ø 5 do u ← EXTRACT-MIN(Q) 6 S ← … Read more

How to generate n different colors for any natural number n? [duplicate]

Yeah. Defining distinct is a product of deferring to a color space then when we say maximally distinct colors what we mean to say is colors which are as far from all the other colors as possible. But since the color space doesn’t change the answer isn’t going to change. And implementing something that better … Read more

What is the meaning of “from distinct vertex chains” in this nearest neighbor algorithm?

This is how I see it, after explanation of Ernest Friedman-Hill (accepted answer): So the example from the same book (Figure 1.4). I’ve added names to the vertices to make it clear So at first step all the vertices are single vertex chains, so we connect A-D, B-E and C-F pairs, b/c distance between them … Read more

Find the paths between two given nodes?

Breadth-first search traverses a graph and in fact finds all paths from a starting node. Usually, BFS doesn’t keep all paths, however. Instead, it updates a prededecessor function π to save the shortest path. You can easily modify the algorithm so that π(n) doesn’t only store one predecessor but a list of possible predecessors. Then … Read more

Two Rectangles intersection

if (X1+W1<X2 or X2+W2<X1 or Y1+H1<Y2 or Y2+H2<Y1): Intersection = Empty else: Intersection = Not Empty If you have four coordinates – ((X,Y),(A,B)) and ((X1,Y1),(A1,B1)) – rather than two plus width and height, it would look like this: if (A<X1 or A1<X or B<Y1 or B1<Y): Intersection = Empty else: Intersection = Not Empty

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)