Skip to main content
Stack Overflow
  1. About
  2. For Teams
Filter by
Sorted by
Tagged with
1 vote
1 answer
100 views

The book Algorithms Illuminated Part 4 has the following definition to prove problems NP-hard: A problem A reduces to another problem B if an algorithm that solves B can be easily translated into one ...
3 votes
0 answers
59 views

A graph G(V,E) is defined by a set of vertices V and a set of edges E. Given W⊆V, find a connected subgraph G'(V',E') of G that satisfies the following conditions: i) ∀p∈V,∃p'∈V' such that p′ is ...
0 votes
0 answers
48 views

I'm looking for an approximation approach to what I am assuming is an NP hard problem. Given a list of sets F = {S1,...,Sm) that contain at most n elements from (0,...,n-1): what is the largest subset ...
0 votes
0 answers
85 views

Problem description: A store has N boxes where sequences of bottles can be placed (a sequence can be empty), with each box having a bonus factor c_i and a weight l_i. There are only K bottles ...
0 votes
1 answer
85 views

As shown in this code, I need to use certain data in one table as a basis to modify another table and add some information. When this kind of table information scale is large, this violent traversal ...
1 vote
1 answer
54 views

I'm trying to write a decision tree learner in numpy. For this, the x values need to be sorted once only and after that i should be able to reuse them. For this, I have a 2d array of features x, of ...
0 votes
1 answer
889 views

A greedy algorithm to find a vertex cover for a given graph would be to greedily select the vertex with the maximum degree and add it to the vertex cover set. Remove the node and all its edges from ...
0 votes
0 answers
59 views

Problem: Given elements and sets that the elements can corespond to, find optimal division these elements to sets, such that number of sets is minimal. Example: 'a' : (1, 2), 'b' : (1, 3), 'c' : (3, 5)...
0 votes
0 answers
35 views

I'm looking for help implementing logic without a loop for the following code. With the present / below code -4D array, I am facing issue since argmin takes just one axis, whereas I need to consider ...
0 votes
1 answer
468 views

I installed NUMPY by using pip install NUMPY and it installed and then I'm still not able to use np. method . the NUMPY version is 1.26.3. the error in "np is not defined". can somebody ...
1 vote
0 answers
182 views

Consider the K-Hamiltonian Path (KHP) decision problem stated below: KHP = (G, K), where: G = (V, E) is an undirected graph of n vertices and m edges K is a positive integer Do there exist at least n/...
1 vote
0 answers
59 views

A k-plex is a graph in which every vertex is adjacent to all but at most k vertices within the graph. Say I have a complete, undirected, weighted graph (a clique and also a k-plex), and I want to ...
1 vote
0 answers
189 views

The general bin-packing problem is NP complete. I have read several papers and other source but I am still not clear about whether a bin-packing problem with a fixed number of bins is NP-hard. ...
2 votes
1 answer
627 views

I am motivated by the post, Complexity of n-queens-completion. I am interested in completion problem of non-attacking rooks on a chessboard. Input: Given a chessboard of size n×ばつn with n−k rooks ...
3 votes
2 answers
166 views

I am trying to solve the following problem: I have several blocked sets (which may contain duplicate elements). I must pick a (varying) number of elements from each blocked set to unblock it. I am ...

15 30 50 per page
1
2 3 4 5
...
34

AltStyle によって変換されたページ (->オリジナル) /