messages listlengths 1 1 | topic stringlengths 2 272 | full_path stringlengths 45 355 |
|---|---|---|
[
{
"role": "user",
"content": "Given a list of integers, compute the number of inversion pairs (i, j) where i < j and arr[i] > arr[j]. The input is a list of integers with n elements, where n can be up to 10^5. The output is the count of such pairs. For example, for input [1, 3, 2], the output is 1. Edge cas... | Runtime Behavior Studies | Coding -> Algorithm Design -> Algorithmic Complexity -> Algorithmic Performance Analysis -> Runtime Behavior Studies |
[
{
"role": "user",
"content": "Given a list of integers, determine the maximum number of elements that can be removed in a single pass, where each removal is of consecutive duplicates. The best case scenario is when all elements are the same, allowing all elements to be removed in one pass. The input is a li... | Optimal Scenario Analysis | Coding -> Algorithm Design -> Algorithmic Complexity -> Best Case Complexity -> Optimal Scenario Analysis |
[
{
"role": "user",
"content": "Implement an Ant Colony Optimization algorithm for a multi-objective shortest path problem. Given a directed graph with nodes and edges, each edge having two weights (cost and time), your task is to find all non-dominated paths from a start node to an end node using m ants over... | Complexity of Ant Colony Optimization for Multi-Objective Problems | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Ant Colony Optimization -> Complexity of Ant Colony Optimization for Multi-Objective Problems |
[
{
"role": "user",
"content": "Given an undirected graph represented as an adjacency list, and a number of colors k, implement an Ant Colony Optimization (ACO) algorithm to find a valid graph coloring (no adjacent nodes have the same color). The algorithm must use a specified number of ants, iterations, and ... | Complexity of Ant Colony Optimization in Constraint Satisfaction | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Ant Colony Optimization -> Complexity of Ant Colony Optimization in Constraint Satisfaction |
[
{
"role": "user",
"content": "Given the number of nodes M, number of ants per node K, number of iterations T, communication cost per message C, and local computation time per ant L, compute the total time taken by the distributed ACO algorithm. Each iteration consists of a local computation phase where each... | Complexity of Ant Colony Optimization in Distributed Systems | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Ant Colony Optimization -> Complexity of Ant Colony Optimization in Distributed Systems |
[
{
"role": "user",
"content": "Compute the total number of operations required to run the Ant Colony Optimization algorithm for a given network. Given the number of nodes N, edges M, number of ants m, number of iterations T, and average path length L per ant, the total operations is calculated as T * (m * L ... | Complexity of Ant Colony Optimization in Large-Scale Networks | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Ant Colony Optimization -> Complexity of Ant Colony Optimization in Large-Scale Networks |
[
{
"role": "user",
"content": "Given initial pheromone level P0, number of ants m, evaporation rate ρ (0 < ρ < 1), a constant k, and a convergence threshold ε (ε > 0), compute the minimal number of iterations T such that after T iterations, the pheromone level P(t) is within ε of the steady-state value P_ss ... | Convergence Rate Complexity in Ant Colony Systems | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Ant Colony Optimization -> Convergence Rate Complexity in Ant Colony Systems |
[
{
"role": "user",
"content": "You are given a list of city coordinates (x, y) in a 2D plane, the number of ants (m), the number of iterations (k), and heuristic parameters alpha and beta. Implement a simplified Ant Colony Optimization algorithm to find the shortest path that visits all cities exactly once. ... | Heuristic Performance Complexity in Ant Colony Systems | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Ant Colony Optimization -> Heuristic Performance Complexity in Ant Colony Systems |
[
{
"role": "user",
"content": "Implement a function that simulates the Ant Colony Optimization algorithm on a given TSP instance. The function should take as input a list of city coordinates, the number of ants (m), the evaporation rate (rho), the heuristic influence (alpha), and the number of iterations (T)... | Parameter Sensitivity Complexity in Ant Colony Methods | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Ant Colony Optimization -> Parameter Sensitivity Complexity in Ant Colony Methods |
[
{
"role": "user",
"content": "Given a directed graph represented as an adjacency list, where each node has a list of outgoing edges with weights, simulate the Ant Colony Optimization algorithm to find the shortest path from node 0 to node N-1. The algorithm's parameters are the number of ants (K), pheromone... | Scalability Analysis of Ant Colony Optimization Algorithms | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Ant Colony Optimization -> Scalability Analysis of Ant Colony Optimization Algorithms |
[
{
"role": "user",
"content": "Given an undirected graph represented as an adjacency list, find a vertex cover with size at most twice the optimal. The graph has n vertices (numbered 1 to n) and m edges. The solution must return the vertex cover as a list of vertices. The algorithm must have a time complexit... | Complexity of Approximating Graph Problems | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Approximation Schemes -> Complexity of Approximating Graph Problems |
[
{
"role": "user",
"content": "Implement a function that determines if a given 3-SAT instance is satisfiable. The input is a list of clauses, where each clause is a list of three integers. Each integer represents a literal: positive numbers are variables, negative numbers are negated variables. For example, ... | 3-SAT Problem | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Boolean Satisfiability -> 3-SAT Problem |
[
{
"role": "user",
"content": "Given a Boolean formula in conjunctive normal form (CNF), compute the number of variables that are not determined by unit propagation. The formula is represented as a list of clauses, where each clause is a list of integers (literals), and each literal is either a positive or n... | Branching Complexity in SAT Solving | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Boolean Satisfiability -> Branching Complexity in SAT Solving |
[
{
"role": "user",
"content": "Given a Boolean formula in 3-CNF (each clause has exactly three literals), determine the minimal number of variables that must be set to true to satisfy all clauses. If no such assignment exists, return -1. The input is a list of clauses, where each clause is a list of three in... | Clause-Literal Relationships | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Boolean Satisfiability -> Clause-Literal Relationships |
[
{
"role": "user",
"content": "Given a Boolean formula in 2-CNF (each clause contains exactly two literals), determine if there exists a satisfying assignment. Each clause is represented as a pair of integers, where positive integers represent variables (e.g., 1 for x₁), and negative integers represent their... | Complexity Analysis of SAT Variants | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Boolean Satisfiability -> Complexity Analysis of SAT Variants |
[
{
"role": "user",
"content": "Implement a function that takes an undirected graph (represented as an adjacency list) and returns a Boolean formula in Conjunctive Normal Form (CNF) that is satisfiable if and only if the graph contains a Hamiltonian cycle. The CNF must be represented as a list of clauses, whe... | Cook-Levin Theorem | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Boolean Satisfiability -> Cook-Levin Theorem |
[
{
"role": "user",
"content": "Given a CNF formula represented as a list of clauses, where each clause is a list of integers (positive for a variable, negative for its negation), implement a function that returns the number of recursive calls made by the DPLL algorithm when processing this formula. Assume th... | DPLL Algorithm Analysis | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Boolean Satisfiability -> DPLL Algorithm Analysis |
[
{
"role": "user",
"content": "Implement a function that determines if a given 2-CNF Boolean formula is satisfiable and returns a satisfying assignment. The formula is represented as a list of clauses, each clause being a pair of literals. Each literal is a non-zero integer, where positive represents the var... | Decision vs. Search Problems | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Boolean Satisfiability -> Decision vs. Search Problems |
[
{
"role": "user",
"content": "Given a positive integer T, compute the minimal number of variables n such that 2^{n/2} ≥ T. The output should be the smallest integer n ≥ 1 satisfying this condition.\n\nInput: A single integer T (1 ≤ T ≤ 10^18).\n\nOutput: An integer n ≥ 1.\n\nExample: For T=8, the output is ... | Lower Bounds for SAT Algorithms | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Boolean Satisfiability -> Lower Bounds for SAT Algorithms |
[
{
"role": "user",
"content": "Given a CNF formula as a list of clauses, each clause is a list of integers representing literals (positive or negative), determine the minimal number of resolution steps required to derive the empty clause. If the formula is satisfiable, return -1. Each resolution step combine... | Resolution Complexity in SAT | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Boolean Satisfiability -> Resolution Complexity in SAT |
[
{
"role": "user",
"content": "Given a Boolean formula in Conjunctive Normal Form (CNF), determine if there exists a satisfying assignment. The formula is represented as a list of clauses, where each clause is a list of integers (positive for variables, negative for negations). The function must use O(n) spa... | Space Complexity in SAT Solving | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Boolean Satisfiability -> Space Complexity in SAT Solving |
[
{
"role": "user",
"content": "Given a CNF formula, count the number of clauses that have more than two literals. Each clause is represented as a list of integers, where each integer represents a literal (positive for a variable, negative for its negation). The input is a list of these clauses.\n\nInput: A l... | Structural Complexity of SAT Instances | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Boolean Satisfiability -> Structural Complexity of SAT Instances |
[
{
"role": "user",
"content": "Implement a function that takes a Boolean formula in Conjunctive Normal Form (CNF) as input and returns the number of recursive calls made by a DPLL-based SAT solver during the solving process. The CNF is represented as a list of clauses, each clause being a list of integers (p... | Time Complexity of SAT Algorithms | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Boolean Satisfiability -> Time Complexity of SAT Algorithms |
[
{
"role": "user",
"content": "You are given a list of integers representing values proposed by nodes in a distributed system, and an integer f representing the maximum number of faulty nodes. Your task is to determine the correct consensus value that the system would agree upon. The correct value is the one... | Consensus with Byzantine Faults | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Consensus Algorithms -> Consensus with Byzantine Faults |
[
{
"role": "user",
"content": "Given a list of integers `values` and an integer `f`, determine the value that appears more than `(n - f)/2` times, where `n` is the length of `values`. If such a value exists, return it; otherwise, return `None`. The input `values` can contain any integer, and `f` is non-negat... | Consensus with Crash Faults | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Consensus Algorithms -> Consensus with Crash Faults |
[
{
"role": "user",
"content": "Implement a data structure that supports the following operations:\n- insert(x): add the integer x to the data structure.\n- delete(x): remove one occurrence of the integer x from the data structure.\n- query(L, R): return the sum of all integers in the data structure that are ... | Data Structure Specific Complexity | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Data Structure Operations -> Data Structure Specific Complexity |
[
{
"role": "user",
"content": "Implement a hash table that supports the following operations:\n1. Insert a key-value pair.\n2. Delete a key-value pair.\n3. Check if a key exists.\nThe hash table must use open addressing with quadratic probing to resolve collisions. It must dynamically resize when the load fa... | Data Structure-Specific Space Analysis | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Data Structure Operations -> Data Structure-Specific Space Analysis |
[
{
"role": "user",
"content": "Implement a data structure that supports the following operations:\n\n- `insert(x)`: Add the integer `x` to the collection.\n- `delete(x)`: Remove one occurrence of `x` from the collection.\n- `find_median()`: Return the median of the collection. The median is defined as the mi... | Data Structure-Specific Time Analysis | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Data Structure Operations -> Data Structure-Specific Time Analysis |
[
{
"role": "user",
"content": "Implement a dynamic data structure that supports the following operations: \n- add(x): add the integer x to the set. \n- remove(x): remove one occurrence of x from the set. \n- query(): return the maximum value in the set. \n\nThe algorithm must adapt its approach based on the ... | Adaptive Complexity in Dynamic Environments | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Dynamic Analysis -> Adaptive Complexity in Dynamic Environments |
[
{
"role": "user",
"content": "Implement a dynamic array that supports the following operations:\n\n- `add(x)`: Append `x` to the end of the array.\n- `remove(i)`: Remove the element at index `i`.\n- `size()`: Return the number of elements in the array.\n\nThe array must be implemented such that the amortize... | Amortized Complexity in Dynamic Systems | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Dynamic Analysis -> Amortized Complexity in Dynamic Systems |
[
{
"role": "user",
"content": "Implement a class that maintains a dynamic collection of integers. The class supports two operations: add(value) and remove(value), which add or remove a single occurrence of a value from the collection. The class also has a method get_sum_pairs() that returns the sum of the pr... | Incremental Computation Complexity | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Dynamic Analysis -> Incremental Computation Complexity |
[
{
"role": "user",
"content": "Given two N x N binary matrices, initial and target, compute the minimum number of operations required to transform initial into target. Each operation is selecting a cell (i,j) and flipping it and its adjacent cells (up, down, left, right). If it's impossible, return -1. N is ... | Reconfiguration Complexity | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Dynamic Analysis -> Reconfiguration Complexity |
[
{
"role": "user",
"content": "Given a binary file containing a sequence of 32-bit integers stored in little-endian format, compute the sum of all integers in the file. The solution must read the file in a way that minimizes I/O operations, ensuring optimal data locality by reading the entire file at once. I... | Data Locality Impact on I/O | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of I/O Operations -> Data Locality Impact on I/O |
[
{
"role": "user",
"content": "You are given k sorted lists of integers, each representing a file. You need to merge all of them into one sorted list. Each read operation from a file can read up to B elements, and each write operation to the output can write up to B elements. Compute the minimal number of I/... | Data Transfer Overhead | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of I/O Operations -> Data Transfer Overhead |
[
{
"role": "user",
"content": "Given a block size K and a list of M queries, each defined by a range [L, R], compute the minimal number of disk I/O operations required to answer all queries. Each query refers to a large array stored in a file divided into blocks of size K, and each block is read as a single ... | Disk Access Complexity | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of I/O Operations -> Disk Access Complexity |
[
{
"role": "user",
"content": "Given the disk head's initial position S and a list of I/O requests with track numbers and priorities ('high' or 'low'), process all high-priority requests first, then low-priority ones. For each priority group, process the requests in an order that minimizes the total seek tim... | Disk Queue Management Complexity | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of I/O Operations -> Disk Queue Management Complexity |
[
{
"role": "user",
"content": "Given a list of integers representing track numbers and the initial position of the disk head, determine the minimal total seek time required to process all requests by moving the disk head from the initial position to the first request, then to the next requests in the order t... | Disk Seek Time Analysis | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of I/O Operations -> Disk Seek Time Analysis |
[
{
"role": "user",
"content": "Given a list of file access frequencies, arrange them into a binary tree (directory structure) such that the total I/O cost, defined as the sum of (frequency * depth of the directory containing the file), is minimized. The root directory has depth 0. Output the minimal total co... | File System Interaction Costs | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of I/O Operations -> File System Interaction Costs |
[
{
"role": "user",
"content": "Given an initial disk head position and a list of file positions (each as a non-negative integer), determine the minimal total seek cost to read all files. The cost is calculated as the sum of the absolute differences between consecutive read positions, starting from the initia... | File System Operation Cost | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of I/O Operations -> File System Operation Cost |
[
{
"role": "user",
"content": "You are given a list of file paths, each pointing to a file containing a sorted list of integers. Your task is to merge all these files into a single sorted list of integers. The function must return the merged list. Each file contains one integer per line. \n\nInput: A list of... | File System Overhead | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of I/O Operations -> File System Overhead |
[
{
"role": "user",
"content": "Given a list of integers representing the durations of I/O operations and an integer K (number of parallel I/O channels), determine the minimal possible makespan (maximum time taken by any channel) when scheduling these operations on K channels. Each channel can process one ope... | I/O Operation Contention | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of I/O Operations -> I/O Operation Contention |
[
{
"role": "user",
"content": "Given an array of N positive integers representing I/O operation times and a synchronization cost S, partition the array into contiguous batches such that the total time is minimized. The total time is the sum of the maximum value in each batch plus the number of batches multip... | I/O Operation Synchronization Cost | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of I/O Operations -> I/O Operation Synchronization Cost |
[
{
"role": "user",
"content": "You are given a list of data item sizes (each as a positive integer), a maximum chunk size M, setup time S, and per-byte transfer time T. Each data item's size is at most M. You can read contiguous data items in a single I/O operation, provided the total size of the chunk does ... | I/O Operation Time Analysis | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of I/O Operations -> I/O Operation Time Analysis |
[
{
"role": "user",
"content": "Given a file path and an integer K, compute the sum of all integers in the file. The file contains one integer per line. The solution must read the file in chunks of K lines at a time, processing each chunk to sum the integers. The program must handle cases where the number of ... | I/O Throughput Limitations | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of I/O Operations -> I/O Throughput Limitations |
[
{
"role": "user",
"content": "You are given a list of N I/O operations, each with a latency value. The total time to execute all operations is the sum of all their latencies plus the sum of the overheads between consecutive operations. The overhead between two consecutive operations is defined as 1 if the l... | Latency Variability in I/O | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of I/O Operations -> Latency Variability in I/O |
[
{
"role": "user",
"content": "You are given k sorted files, each containing a list of integers. Each file is stored in blocks of size B. To read a block from a file, it is one I/O operation. You need to find the k-th smallest element across all files, using the minimal number of I/O operations. \n\nConstrai... | Memory Transfer Efficiency | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of I/O Operations -> Memory Transfer Efficiency |
[
{
"role": "user",
"content": "Given a list of integers representing the sizes of files to be read and an integer K representing the maximum number of concurrent I/O operations allowed, determine the minimal total time required to read all files. Each I/O operation takes time equal to the file size, and you ... | Parallel I/O Complexity | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of I/O Operations -> Parallel I/O Complexity |
[
{
"role": "user",
"content": "You are given a large text file where each line contains an integer. Compute the sum of all integers in the file. The file is too large to fit into memory, so you must read it in chunks of K lines, where K is a given parameter. Each read operation reads a block of K lines, and ... | Pipeline I/O Efficiency | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of I/O Operations -> Pipeline I/O Efficiency |
[
{
"role": "user",
"content": "Given a list of integers representing I/O request track numbers, and the disk head starts at position 0, simulate the Shortest Seek Time First (SSTF) algorithm to calculate the total time required to process all requests. Each I/O request takes 1 unit of time to process, and th... | I/O Latency Bounds | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of I/O Scheduling -> I/O Latency Bounds |
[
{
"role": "user",
"content": "Given a list of memory access requests (each represented by a block number) and a cache size C, determine the minimal number of cache misses that can be achieved using the optimal page replacement strategy. The cache is initially empty. Each cache miss results in an I/O operati... | Memory Hierarchy Constraints | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of I/O Scheduling -> Memory Hierarchy Constraints |
[
{
"role": "user",
"content": "Given a primal integer programming problem in standard form (maximize c^T x subject to A x ≤ b, x ≥ 0 integers), generate the dual problem. The dual is a minimization problem with m variables y_i ≥ 0 and constraints A^T y ≥ c. The objective is to minimize b^T y. The input inclu... | Integer Programming Duality | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Integer Programming -> Integer Programming Duality |
[
{
"role": "user",
"content": "Given an array of positive integers, a target sum T, and a required subset size K, determine whether there exists a subset of exactly K elements whose sum is exactly T. The input array has N elements (1 ≤ N ≤ 100), each element is between 1 and 10^4, T is up to 10^5, and K is b... | Integer Programming Pseudopolynomial Time | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Integer Programming -> Integer Programming Pseudopolynomial Time |
[
{
"role": "user",
"content": "Given a list of constraints, each of the form a_i * x + b_i * y ≤ c_i, where a_i, b_i, c_i are integers, determine if there exists an integer pair (x, y) that satisfies all constraints. Output \"YES\" if such a pair exists, otherwise \"NO\". \nInput: A list of constraints, whe... | NP-Hardness of Integer Programming | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Integer Programming -> NP-Hardness of Integer Programming |
[
{
"role": "user",
"content": "Given two integers A and B, find the maximum value of 3x + 5y where x and y are integers ≥0 satisfying x + y ≤ A and 2x + 3y ≤ B. Return the maximum value.\n\nThe input is two integers A and B. The output is an integer.\n\nExample: Input A=5, B=10 → Output 16."
}
] | Solving Integer Programs with Linear Programming Bounds | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Integer Programming -> Solving Integer Programs with Linear Programming Bounds |
[
{
"role": "user",
"content": "Given an undirected graph represented as an adjacency list and a parameter $ k $, apply the kernelization steps for the Vertex Cover problem. Return the size of the kernel if possible, or -1 if it's not solvable. The kernelization steps are:\n\n1. While any vertex has degree > ... | Kernelization and Reduction Rules | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Kernelization -> Kernelization and Reduction Rules |
[
{
"role": "user",
"content": "Given an undirected graph represented as an adjacency list (a dictionary where each key is a node and the value is a list of adjacent nodes), and an integer k, perform kernelization steps for the vertex cover problem. Return the kernelized graph (adjacency list) if possible, ot... | Kernelization in Graph Problems | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Kernelization -> Kernelization in Graph Problems |
[
{
"role": "user",
"content": "Given a string S and an integer k, determine the length of the longest substring that contains at most k distinct characters. The solution must kernelize the string by truncating it to a length of min(len(S), k^2 + 1) before applying the sliding window algorithm. Inputs: S is a... | Kernelization in String Problems | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Kernelization -> Kernelization in String Problems |
[
{
"role": "user",
"content": "Given a primal linear programming problem in standard form (maximize c^T x subject to Ax ≤ b, x ≥ 0), generate the dual problem's parameters. The dual problem is to minimize b^T y subject to A^T y ≥ c, y ≥ 0. The input consists of the primal's objective coefficients c (a list o... | Duality Theory in LP | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Linear Programming -> Duality Theory in LP |
[
{
"role": "user",
"content": "Given a directed graph with weighted edges, determine if there exists a real-valued function f on the vertices such that for every edge (u, v), f(u) - f(v) ≤ c_uv. The input is a list of edges, each represented as (u, v, c), where u and v are integers (vertex identifiers), and ... | Feasibility Problem Complexity | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Linear Programming -> Feasibility Problem Complexity |
[
{
"role": "user",
"content": "Given an undirected graph represented as an adjacency list, return the optimal value of the LP relaxation for the minimum vertex cover problem. The LP relaxation is defined as follows: For each vertex v, let x_v be a variable in [0, 1]. For each edge (u, v), add the constraint ... | NP-Hardness in LP | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Linear Programming -> NP-Hardness in LP |
[
{
"role": "user",
"content": "Given a convex polygon in 2D defined by a list of linear inequalities, each in the form ax + by ≤ c, and a linear function f(x, y) = px + qy + r, compute the maximum value of f over the polygon. The input consists of the list of inequalities and the coefficients of f. The outpu... | Optimization Over Polytopes | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Linear Programming -> Optimization Over Polytopes |
[
{
"role": "user",
"content": "Implement the simplex method with the Dantzig pivot rule to solve a linear programming problem and return the number of iterations required to reach optimality. The input consists of the constraint matrix A (m x n), the right-hand side vector b (m), and the objective function v... | Pivot Rule Complexity | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Linear Programming -> Pivot Rule Complexity |
[
{
"role": "user",
"content": "Given a list of 2D points, compute the number of edges in their convex hull. The input is a list of tuples (x, y) where x and y are integers. The output is the number of edges in the convex hull. For example, the input [(0,0), (1,0), (1,1), (0,1)] should return 4. Edge cases in... | Polyhedral Complexity | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Linear Programming -> Polyhedral Complexity |
[
{
"role": "user",
"content": "Given a linear programming problem with m constraints and n variables, and the current optimal basis along with the current values of the basic variables, compute the allowable range for the RHS of the i-th constraint such that the current basis remains optimal. The input inclu... | Sensitivity Analysis Complexity | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Linear Programming -> Sensitivity Analysis Complexity |
[
{
"role": "user",
"content": "Given a positive integer n representing the number of variables in a Klee-Minty cube linear programming problem, compute the maximum number of iterations the Simplex Method could take in the worst-case scenario. The Klee-Minty cube for n variables requires 2^n - 1 iterations. R... | Simplex Method Analysis | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Linear Programming -> Simplex Method Analysis |
[
{
"role": "user",
"content": "Given an array of server loads and a migration cost matrix, determine the minimal total migration cost required to balance the servers' loads such that each server has the same load. If it's not possible, return -1. \n\nInput:\n- `servers`: a list of integers representing the c... | Load Balancing with Migration Costs | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Load Balancing -> Load Balancing with Migration Costs |
[
{
"role": "user",
"content": "Given an array of integers representing the durations of tasks and an integer k representing the number of workers, assign each task to a worker in a way that minimizes the maximum load on any worker. The assignment must be done sequentially: for each task, assign it to the wor... | Sequential Load Balancing | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Load Balancing -> Sequential Load Balancing |
[
{
"role": "user",
"content": "Given a list of integers representing task durations and an integer k representing the number of servers, assign each task to a server such that the maximum load on any server is minimized. Return this minimal maximum load. The tasks cannot be split and must be assigned to exac... | Static Load Balancing | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Load Balancing -> Static Load Balancing |
[
{
"role": "user",
"content": "You are given a list of memory requests, each represented as a tuple (start_time, end_time, required_size). The system can allocate memory blocks to satisfy these requests. Each block can be assigned multiple requests as long as their time intervals do not overlap. The size of ... | Predictive Memory Allocation | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Memory Scheduling -> Predictive Memory Allocation |
[
{
"role": "user",
"content": "Given a list of positive integers representing the error values of a metaheuristic algorithm at each iteration, compute the convergence rate k as the absolute value of the slope of the linear regression line of ln(error) against the iteration index. The output should be rounded... | Convergence Rate Analysis of Metaheuristics | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Metaheuristic Algorithms -> Convergence Rate Analysis of Metaheuristics |
[
{
"role": "user",
"content": "You are given a positive integer n (the problem size) and a positive integer T (maximum allowed iterations). The runtime of a metaheuristic algorithm for this problem is determined by two parameters: k (population size) and m (mutation rate). The runtime is given by the formula... | Parameter Sensitivity in Metaheuristic Complexity | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Metaheuristic Algorithms -> Parameter Sensitivity in Metaheuristic Complexity |
[
{
"role": "user",
"content": "Given the population size P (integer ≥ 1), the length of each individual L (integer ≥ 1), and the number of generations G (integer ≥ 1), compute the maximum space required (in bytes) for a genetic algorithm that stores all generations. The space includes: 1. Population storage:... | Space Complexity in Metaheuristic Algorithms | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Metaheuristic Algorithms -> Space Complexity in Metaheuristic Algorithms |
[
{
"role": "user",
"content": "Given a list of packet processing times, a number of servers S, and a maximum allowed backlog B, determine if the system can process all packets such that the maximum backlog never exceeds B. The packets arrive in the worst possible order chosen by an adversary, which is assume... | Adversarial Queuing Theory | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Online Algorithms -> Adversarial Queuing Theory |
[
{
"role": "user",
"content": "Implement a function `compute_iterations(gradient, L, x0, epsilon)` that returns the number of iterations required for gradient descent with step size 1/L to reach a point where the gradient norm is less than epsilon. The gradient function is given as a function that takes a sc... | Complexity of Convex Optimization | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Optimization Techniques -> Complexity of Convex Optimization |
[
{
"role": "user",
"content": "Implement a gradient descent algorithm to minimize the function f(x) = x^4 - 3x^3 + 2x^2. The algorithm should use a fixed learning rate of 0.1, start from an initial guess of x0 = 1.0, and stop when the absolute change in x is less than 1e-6. Return the number of iterations re... | Complexity of Gradient-Based Methods | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Optimization Techniques -> Complexity of Gradient-Based Methods |
[
{
"role": "user",
"content": "Given the number of variables `n` (a positive integer) and a desired precision `ε` (a positive real number less than 1), compute the number of iterations required for an interior point method to achieve the precision. The number of iterations is the ceiling of `sqrt(n) * ln(1/ε... | Complexity of Interior Point Methods | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Optimization Techniques -> Complexity of Interior Point Methods |
[
{
"role": "user",
"content": "Implement a function that takes two integers, m (number of constraints) and n (number of variables), and returns a string representing the computational complexity of solving a linear programming problem using the interior-point method. The complexity should be expressed as \"O... | Computational Complexity of Linear Programming | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Optimization Techniques -> Computational Complexity of Linear Programming |
[
{
"role": "user",
"content": "Given a list of jobs, each with a processing time, a deadline, and a profit, determine the maximum total profit achievable by selecting a subset of jobs that can be scheduled on a single machine without any job missing its deadline. The machine can process jobs in any order, bu... | NP-Hardness in Optimization | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Optimization Techniques -> NP-Hardness in Optimization |
[
{
"role": "user",
"content": "Given an undirected graph represented as an adjacency matrix, determine the size of the maximum clique. The graph has n nodes, where n is between 1 and 15. The adjacency matrix is a 2D list of integers (0 or 1), with matrix[i][j] = 1 if there is an edge between node i and node ... | NP-Hardness of Combinatorial Optimization Problems | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Optimization Techniques -> NP-Hardness of Combinatorial Optimization Problems |
[
{
"role": "user",
"content": "Implement the golden-section search algorithm to find the minimum value of a unimodal and convex function on a given interval [a, b] within a specified tolerance ε. The algorithm must ensure a time complexity of O(log(1/ε)). The function f is provided as a callable, and the out... | Nonlinear Programming Complexity | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Optimization Techniques -> Nonlinear Programming Complexity |
[
{
"role": "user",
"content": "Given a complete graph with n nodes, where each edge has a non-negative weight, find the shortest possible Hamiltonian cycle (a cycle that visits each node exactly once and returns to the starting node). The output should be the total weight of the optimal cycle. The input is a... | P vs NP in Optimization Problems | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Optimization Techniques -> P vs NP in Optimization Problems |
[
{
"role": "user",
"content": "Given an undirected graph G and an integer k, determine if it is possible to remove at most k edges from G to make it bipartite. Output the minimum number of edges that need to be removed, or -1 if it is impossible. The graph is represented as an adjacency list, with n nodes la... | Parameterized Complexity in Optimization | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Optimization Techniques -> Parameterized Complexity in Optimization |
[
{
"role": "user",
"content": "Given an undirected, unweighted graph represented as an adjacency list, and a source node, compute the maximum distance from the source node to any other node in the graph. This represents the time complexity of a parallel BFS algorithm where each level is processed in parallel... | Complexity of Parallel Graph Algorithms | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Parallel Algorithms -> Complexity of Parallel Graph Algorithms |
[
{
"role": "user",
"content": "Given integers n (number of elements) and p (number of processors), where 1 ≤ p ≤ n, compute the time complexity of sorting the array using a parallel merge sort algorithm. The time complexity is calculated as (n/p) * log2(n/p) + log2(p), rounded up to the nearest integer. Retu... | Complexity of Parallel Sorting Algorithms | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Parallel Algorithms -> Complexity of Parallel Sorting Algorithms |
[
{
"role": "user",
"content": "Given an array A of size N and a list of operations. Each operation is a tuple (thread_id, index, value). For each operation, the thread attempts to write the value to the specified index in the array. If multiple threads write to the same index, the value stored at that index ... | Concurrent Read Concurrent Write (CRCW) | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Parallel Algorithms -> Concurrent Read Concurrent Write (CRCW) |
[
{
"role": "user",
"content": "Given a directed acyclic graph (DAG) with n nodes and m edges, compute the length of the longest path in the graph. The nodes are labeled from 0 to n-1, and each edge has a weight of 1. The output should be the number of edges in the longest path. Constraints: n ≤ 10^5, m ≤ 10^... | Parallel Algorithm Lower Bounds | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Parallel Algorithms -> Parallel Algorithm Lower Bounds |
[
{
"role": "user",
"content": "Given a list of integers representing the processing times of tasks and an integer p representing the number of processors, determine the minimal possible makespan, which is the maximum time any processor spends processing tasks. The makespan is the maximum between the ceiling ... | Parallel Algorithm Scalability | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Parallel Algorithms -> Parallel Algorithm Scalability |
[
{
"role": "user",
"content": "Given a directed acyclic graph (DAG) with N nodes and M edges, find the length of the longest path in the graph. The length of a path is defined as the number of edges in the path. The graph is represented as an adjacency list, where each node is labeled from 1 to N. The output... | Parallel Depth Complexity | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Parallel Algorithms -> Parallel Depth Complexity |
[
{
"role": "user",
"content": "Given an array of integers, compute the sum of all elements using a parallel algorithm that runs in O(log n) time on a PRAM model with O(n) processors. The function should return the sum. The input array can be up to 10^6 elements in length. Edge cases include empty arrays and ... | Parallel Random Access Machine (PRAM) Complexity | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Parallel Algorithms -> Parallel Random Access Machine (PRAM) Complexity |
[
{
"role": "user",
"content": "Implement a function that computes the number of distinct triplets (i, j, k) in an array A of length n such that i < j < k and A[i] + A[j] = A[k]. The solution must ensure that the parallel work complexity is O(n³), and the function should return the count of such triplets. Inp... | Parallel Work Complexity | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Parallel Algorithms -> Parallel Work Complexity |
[
{
"role": "user",
"content": "Given an array of integers, compute the sum of the squares of all elements using a parallel divide-and-conquer algorithm. The algorithm must have a Work-Depth complexity of O(n) and O(log n), respectively. The input is a list of integers, and the output is the sum of the square... | Work-Depth Complexity | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Parallel Algorithms -> Work-Depth Complexity |
[
{
"role": "user",
"content": "Given an undirected graph represented as an adjacency list and a positive integer k, determine if the graph has branchwidth at most k. The branchwidth of a graph is defined as the minimum width of a branch decomposition of the graph, where the width is the maximum number of edg... | Branchwidth and Rankwidth | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Parameterized Algorithms -> Branchwidth and Rankwidth |
[
{
"role": "user",
"content": "Given a graph G with n vertices and m edges, and an integer k, determine if there exists a subset of vertices of size at most k whose removal makes G bipartite. The solution must be based on a branch decomposition of the graph with branchwidth ≤k. Assume the branch decompositio... | Branchwidth-Based Algorithms | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Parameterized Algorithms -> Branchwidth-Based Algorithms |
[
{
"role": "user",
"content": "Determine whether a given undirected graph is a cograph. A cograph is a graph that does not contain an induced path of four vertices (P4) as a subgraph. Input: An integer n (number of vertices) and a list of edges represented as pairs of integers. Output: A boolean indicating w... | Cliquewidth and Rankwidth Applications | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Parameterized Algorithms -> Cliquewidth and Rankwidth Applications |
[
{
"role": "user",
"content": "Implement a data structure that dynamically maintains a set of intervals on the real line, supporting insertions, deletions, and queries. For a query with a parameter `k`, determine if there exists a point `x` covered by exactly `k` intervals in the current set. The data struct... | Dynamic Parameterized Algorithms | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Parameterized Algorithms -> Dynamic Parameterized Algorithms |
[
{
"role": "user",
"content": "Given a graph G, its tree decomposition T (represented as a rooted tree where each node contains a bag of vertices), and a weight function for each vertex, compute the maximum weight of an independent set in G using dynamic programming on the tree decomposition. The tree decomp... | Dynamic Programming on Tree Decompositions | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Parameterized Algorithms -> Dynamic Programming on Tree Decompositions |
[
{
"role": "user",
"content": "Given an undirected graph G represented as an adjacency list (list of lists), and a non-negative integer k, determine if there exists a subset of vertices S with size at most k such that removing S from G results in a bipartite graph. Output True if such a subset exists, False ... | FPT Algorithms for Graph Problems | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Parameterized Algorithms -> FPT Algorithms for Graph Problems |
[
{
"role": "user",
"content": "Given a directed graph represented as an adjacency list and an integer k, determine whether there exists a simple path (no repeated nodes) in the graph with at least k edges. The graph can have cycles, but the path must be simple. The input is the adjacency list (a list of list... | Longest Path Parameterization | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Parameterized Algorithms -> Longest Path Parameterization |
[
{
"role": "user",
"content": "Given an undirected graph G and an integer k, determine if there exists a vertex ordering such that for every vertex v, the number of its neighbors that appear after v in the ordering is at most k. The graph is represented as an adjacency list. The output is True if such an ord... | Pathwidth-Based Algorithms | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Parameterized Algorithms -> Pathwidth-Based Algorithms |
[
{
"role": "user",
"content": "Given a graph G and an integer k, determine if there exists a subset S of vertices with size at most k such that removing S from G results in a cograph. The graph is represented as an adjacency list, and the output is a boolean indicating the existence of such a subset S."
}
... | Rankwidth-Based Algorithms | Coding -> Algorithm Design -> Algorithmic Complexity -> Complexity of Parameterized Algorithms -> Rankwidth-Based Algorithms |
End of preview. Expand in Data Studio
README.md exists but content is empty.
- Downloads last month
- 56