Category "optimization"

how to write ant colony optimization code

i have a function function t=strength(x) t(1) = -0.804-0.001.*x(1)-0.001.*x(2)+0.0.*x(3)+0.0.*x(4)-0.031.*x(5)+0.005.*x(6)-0.002.*x(7)+0.001.*x(8)-0.735.

Time and Space complexity of the max disk space

from collections import deque def findMax(hardDiskSpace, k): n = len(hardDiskSpace) if n * k == 0: return [] if k > n: return []

Shorten JSON reading class

I have a simple JSON reading class that should grab values from a JSON object and put it in c# variables. Right now it uses 8 if statements, but I was wondering

how to model a GEKKO constraint to guarantee the count of variables with same value > k

I have the following objective function : Minimize(sum(abs(di[i]-d[i]) ) ) and I want to add a constraint to make sure that d[i] is appeared at least k times i

TensorFlow optimisation during running model speed up Predict

I want to disable a computation of several filters during Predict call with Tensorflow 2 and Keras. Do i have to modify the source code of Tensorflow to achieve

RL + optimization: how to do it better?

I am learning about how to optimize using reinforcement learning. I have chosen the problem of maximum matching in a bipartite graph as I can easily compute the

Python GEKKO: Objective function not showing correct results

I am trying to optimize the trajectory of a thrust propelled system. The control variable is the mass flow rate, and the final objective is to maximize the mass

GEKKO does not find optimal solution for a moon lander that does not go to zero height at zero speed

I'm trying to solve an optimal control problem where a person lands on the Moon, but has a device that can propel her upwards, via a control parameter, alpha. T

Cut a large cuboid into random small cuboids whose dimensions are within a certain range

I am trying to cut a large cuboid of dimension (L, W, H) into N (N can be an arbitrary number and doesn't need to be specified) small cuboids where length and w

Saving results of CPLEX with flow control (change data solve with regenerate)

After looking through stackoverflow + IBM forum + Alex Fleischer's How to Linkedin page, I manage to run my problem with script, changing a parameter at every i

Dodging the performance hit from using `in` with a struct without making the struct readonly?

C# 7.2 added two new features: In Parameters Using in for a parameter let's us pass by reference, but then prevents us from assigning a value to it. However the

How to use Google's "SimpleMinCostFlow" - C#

I want to create a Max Flow - Min Cost program in C# -Visual studio. I'm using this Guide , but I get error at this line MinCostFlow minCostFlow = new MinCostFl

Cplex Python Gaps

How can I print the gaps(each iteration) like OPL's engine in Python? I want to keep the gaps like this: Nodes Cuts

Apache performance tuning for high traffic with MPM Event

I currently manage the following set of servers that serve about 700 web pages: SERVER 1 (WEB) Web server: Apache 2.4.29 with MPM Event PHP 7.2.22 CPU: Intel

Slow MySQL query on 2mill record table despite indexes

Struggling to understand why my query is taking ~8-12s to complete when my table has millions of rows. I can force it to use a specific index, and depending on

Shortest Flow Layout Solver

I have a routing sequence for a set of machines on an assembly line. Each route has to go through the entire line (that is, if you only run the first and second

Python Optimizating the Van sequence

I am writing a code on python for the platform Coding Games . The code is about Van Eck's sequence and i pass 66% of the "tests". Everything is working as expec

How should I implement the init method? In a stateful or stateless widget?

What is the rule of thumb to use an initial method for a widget. Shall I use the: A. classical stateful widget approach? Or is it better to stick with the B. s

ExpansionTile lagging when expanding with a lot of children

Hello ! Everything is in the title. I have an expansion tile to show members of a group. When lots of people are in a group (here 47), the expansion is not smoo

BigQuery Stored Procedure VS BigQuery Scripts

I am able to perform a task of join and aggregation using both Big Query Script and BigQuery Stored Procedure, which is better , which one should be my first ch