Click here to Skip to main content
15,797,721 members
Home / Discussions / Algorithms
   

Algorithms

 
GeneralRe: Can D simulated by H terminate normally? Pin
jschell16-May-23 8:16
jschell16-May-23 8:16 
QuestionBase building in a RTS based on a queue of orders Pin
Calin Negru27-Apr-23 5:01
Calin Negru27-Apr-23 5:01 
AnswerRe: Base building in a RTS based on a queue of orders Pin
Gerry Schmitz27-Apr-23 6:33
mveGerry Schmitz27-Apr-23 6:33 
General[edited]Re: Base building in a RTS based on a queue of orders Pin
Calin Negru27-Apr-23 9:01
Calin Negru27-Apr-23 9:01 
GeneralRe: [edited]Re: Base building in a RTS based on a queue of orders Pin
Gerry Schmitz29-Apr-23 4:48
mveGerry Schmitz29-Apr-23 4:48 
General[edit][edit]Re: Base building in a RTS based on a queue of orders Pin
Calin Negru30-Apr-23 6:23
Calin Negru30-Apr-23 6:23 
GeneralRe: [edit][edit]Re: Base building in a RTS based on a queue of orders Pin
Gerry Schmitz30-Apr-23 7:14
mveGerry Schmitz30-Apr-23 7:14 
GeneralRe: [edit][edit]Re: Base building in a RTS based on a queue of orders Pin
Calin Negru30-Apr-23 23:12
Calin Negru30-Apr-23 23:12 
GeneralRe: [edit][edit]Re: Base building in a RTS based on a queue of orders Pin
Gerry Schmitz1-May-23 1:08
mveGerry Schmitz1-May-23 1:08 
GeneralRe: [edited]Re: Base building in a RTS based on a queue of orders Pin
Calin Negru30-Apr-23 6:10
Calin Negru30-Apr-23 6:10 
GeneralRe: [edited]Re: Base building in a RTS based on a queue of orders Pin
Gerry Schmitz30-Apr-23 7:29
mveGerry Schmitz30-Apr-23 7:29 
QuestionEfficiently finding position in sorted list Pin
Robert Ellis26-Mar-23 14:52
Robert Ellis26-Mar-23 14:52 
AnswerRe: Efficiently finding position in sorted list Pin
Mircea Neacsu26-Mar-23 15:42
Mircea Neacsu26-Mar-23 15:42 
Hmm, if I understand correctly, we have a list of Q positions where each one has a specific range say:
1 - [m_1, u_1]
2 - [m_2, u_2]
...
q - [m_q, u_q]
where m_1 to m_q are the minimum values and u_1 to u_q are the maximum (upper) values. A valid arrangement (I wouldn't call it a permutation) V = [v_1, v_2, ... v_q] can be "normalized" by subtracting the vector M = [m_1, m_2, ..., m_q] of minimum values. Let N = V-M be the normalized vector and R = U-M be the vector of ranges. Note that n_i < r_i.

I will change your problem to set the least significant position to be position 1 just for ease of notation. Then position of V in the list of arrangements is given by the sum:
S = n_1 + n_2*r_1+n3*r_1*r_2 + ...n_q * r_1*r_2*...*r_q-1

This is a bit like expressing a number in a "variable" base. The number of "digits" available at position i is r_i.
Mircea

QuestionDijkstra Pin
Calin Negru13-Dec-22 8:46
Calin Negru13-Dec-22 8:46 
AnswerRe: Dijkstra Pin
jschell13-Dec-22 11:39
jschell13-Dec-22 11:39 
GeneralRe: Dijkstra Pin
Calin Negru13-Dec-22 23:34
Calin Negru13-Dec-22 23:34 
GeneralRe: Dijkstra Pin
jschell20-Dec-22 14:21
jschell20-Dec-22 14:21 
GeneralRe: Dijkstra Pin
Calin Negru26-Dec-22 10:26
Calin Negru26-Dec-22 10:26 
GeneralRe: Dijkstra Pin
jschell29-Dec-22 12:20
jschell29-Dec-22 12:20 
GeneralRe: Dijkstra Pin
Calin Negru30-Dec-22 9:56
Calin Negru30-Dec-22 9:56 
GeneralRe: Dijkstra Pin
harold aptroot2-Jan-23 7:45
harold aptroot2-Jan-23 7:45 
AnswerRe: Dijkstra Pin
Eddy Vluggen2-Jan-23 11:48
professionalEddy Vluggen2-Jan-23 11:48 
GeneralRe: Dijkstra Pin
Graeme_Grant2-Jan-23 12:41
mvaGraeme_Grant2-Jan-23 12:41 
QuestionRe: Dijkstra Pin
Eddy Vluggen2-Jan-23 12:59
professionalEddy Vluggen2-Jan-23 12:59 
AnswerRe: Dijkstra Pin
Graeme_Grant2-Jan-23 13:16
mvaGraeme_Grant2-Jan-23 13:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.