Skip to main content
The 2024 Developer Survey results are live! See the results

All Questions

Tagged with
3 votes
2 answers
105 views

A more efficient algorithm in finding the number of distinct decompositions a number has using only repdigits

This is a problem from a previous semester that I am trying to upsolve. I am trying to solve a problem involving the total number of ways of decomposing a number using only repdigits. A repdigit is a ...
Lesserrafim's user avatar
-1 votes
0 answers
66 views

How to determine if a node in graph is connected to another node efficiently? [closed]

Now I know some people will suggest DFS or BFS etc etc, but I am looking for other faster approaches. The graph I'm working on has "mixed" directions - some edges are directed but some aren'...
UndefinedCpp's user avatar
5 votes
3 answers
218 views

Multiplication of huge massive of numbers in python

I'm working on a small python program for myself and I need an algorithm for fast multiplication of a huge array with numbers (over 660 000 numbers, each is 9 digits). The result number is over 4 ...
Sergio's user avatar
  • 53
1 vote
0 answers
51 views

Generate path between 2 points to achieve a desired momentum [closed]

I have 2 points and I need to find a path between them to maximize momentum. You can consider this as a trajectory of a Racquet hitting a tennis ball. In the image above, the momentum in the ...
Pratham's user avatar
  • 95
0 votes
1 answer
68 views

Word Hunt DFS Algorithm Not Finding Optimal Solution

I am trying to code an algorithm for the Word Hunt game on Iphone Game Pigeon. How word hunt works: There is a 4x4 grid of letters given to each player. Each player must form words that are three ...
Siddd's user avatar
  • 31
1 vote
0 answers
24 views

Ask a coding problem for the equivalence of unconstrained Optimization with L1 Regularization [migrated]

I recently read a statistics paper. It has an unconstrained problem: $$\min_\theta F(\theta)+\lambda || \theta||_1$$, where $$F(\theta)=L(\theta)+\frac{\rho}{2}|h(W(\theta))|^2+ \alpha h(W(\theta))$$ $...
PiVoyager's user avatar
2 votes
0 answers
21 views

SMAC with MFFacade returns None

I'm using SMAC (Sequential Model-based Algorithm Configuration) to optimize hyperparameters for training a model (specifically, a PPO agent) using Stable Baselines3. During the training phase, the ...
Gonzalo's user avatar
  • 21
0 votes
0 answers
13 views

Using proxsuite within CVXPY

I have just installed "proxsuite" package for optimization purposes. In the main page of the package, it is stated that this is already incorporated in CVXPY. However, I am not able to call ...
user25768957's user avatar
3 votes
1 answer
110 views

How can I reduce the time complexity of the solution my subset optimization problem?

I have a list of tuples (a, b) of two unrelated positive integers. I am trying to create another list based off of this that maximizes the sum of a, while staying above a threshold. I also have two ...
MManke's user avatar
  • 133
0 votes
1 answer
89 views

How to make this Python function even faster, lists processing

I was doing a Hackerrank question (I already finished that test, I am just asking because I am curious). Most of test cases were successful but a few said that it took too long, so I had to optimize ...
Andres Masis's user avatar
0 votes
0 answers
25 views

Optimizing a process in several steps : how to train a model if we use it several times before being able to calculate the loss?

I have a process in a certain number of steps ; let's say 3. We start with an initialized null matrix M0 which describes the state of our system, and have to take an action which consequences are ...
Ph W's user avatar
  • 9
4 votes
3 answers
247 views

Minimum Cell Changes to Ensure Unique Numbers in Each Row and Column of an n×n Table

We have an n×n table, and in each cell of the table, there is a number from 1 to 2n. We want to change the numbers in some of the cells and replace them with other numbers from 1 to 2n such that in ...
Mason Kane's user avatar
-2 votes
1 answer
52 views

Seeking Assistance for Image Path Optimization Algorithm

I'm currently tackling a challenge involving image path optimization and could use some assistance refining my algorithm. Picture an image represented as an array of integers, with each pixel holding ...
Bredosen's user avatar
0 votes
1 answer
85 views

how to optimize a sql

I'm a beginner in data structures and algorithms, and I'm not sure how to apply them in practice to specific problems. I want to query book_name & user_id, as well as VP and UV, and I've used ...
user24147317's user avatar
2 votes
1 answer
58 views

Graph node coloring with minimal distance within same group

I have a list of edges with weights (node1 node2 weight) as an input for an undirected graph. A B 10 A C 9 A D 2 B C 1 I also have a list of colors as input like below: Red: 2 Blue: 2 Let's say we ...
mbison's user avatar
  • 147

15 30 50 per page
1
2 3 4 5
188