Processing of Python Programming constraints of simulated annealing algorithm
1. Optimization and linear programming
The three elements of optimization problem are decision variables, objective function and constraints.
Linear programming is an optimization method to study the extreme value problem of linear objective function under linear constraints. It is often used to solve the problem of using existing resources t ...
Posted by Bman900 on Fri, 18 Feb 2022 14:20:59 +0100
[LeetCode - Java]350. Intersection of two arrays II (simple)
1. Title Description
2. Problem solving ideas
Intersection means to have a "global view" of the two arrays. One embodiment of the "global view" in the program is statistics. Therefore, I can use the hash table to count the occurrence times of each element in the two arrays, and then take the small value to build a ne ...
Posted by Rowno on Fri, 18 Feb 2022 13:13:51 +0100
0x03 basic algorithm - recursion
1.A [HNOI2003] laser bomb
Link: https://ac.nowcoder.com/acm/contest/999/A Source: niuke.com
A new type of laser bomb can destroy all targets in a square with side length R. Now there are n(N ≤ 10000) targets on the map. The integer Xi and Yi (whose value is [05000]) represent the position of the target on the map, and each target has a val ...
Posted by web_loone_08 on Fri, 18 Feb 2022 12:58:22 +0100
Two way bfs -- dimension reduction attack on the rearrangement of the nine palaces
What is bidirectional bfs?
Ordinary bfs traverses downward from one vertex, while bidirectional bfs traverses downward and upward from the two endpoints in turn when the end point is known, until the number of layers overlaps with the previous traversal, the answer comes out. It is clear that a two-way bfs needs to meet a necessary cond ...
Posted by riversr54 on Fri, 18 Feb 2022 12:45:29 +0100
Division of [interval DP] convex polygon
Topic source
Click me to enter the ACwing official website to submit
Title Description
Given a convex polygon with n vertices, label the vertices from 1 to N, and the weight of each vertex is a positive integer.
Divide the convex polygon into N − 2 disjoint triangles. For each triangle, the weights of its three vertices can be multipl ...
Posted by jamesjohnson88 on Fri, 18 Feb 2022 10:04:32 +0100
Data structure - Chapter 3 linked list
List
1. Introduction
1.1. Abstract Data Types(ADTS)
ADT definition: a set of objects together with a set of operations Abstract data types are mathematical abstractions; nowhere in an ADT‟s definition is there any mention of how the set of operations is implemented. A set of objects and a set of operations. Abstract data types are mathemat ...
Posted by ryanh_106 on Fri, 18 Feb 2022 07:31:24 +0100
MsgPack/Json performance data
Msgpack / Jason performance data comparison
MsgPack is an efficient binary serialization format. Like Jason, it can exchange data between languages and is used to serialize and store data. The advantage is that when the data scale is large, it is more efficient and occupies less resources than Jason; The disadvantage is that it is not easy to ...
Posted by tpl41803 on Fri, 18 Feb 2022 05:54:19 +0100
Linear regression
Univariate linear regression
Model description
For the model affected by a single variable, we usually abstract it into the form of univariate primary function, and we assume a hypothetical function H( θ)=θ 0+ θ 1x
Cost function
When we make a hypothetical function, we need to determine θ 0 and θ 1 the values o ...
Posted by Tanus on Fri, 18 Feb 2022 04:07:40 +0100
JS: binary search - subsequence, envelope nesting, 0 of order multiplier
35. Search insertion position (simple)
Given a sort array and a target value, find the target value in the array and return its index. If the target value does not exist in the array, return the position where it will be inserted in order.
You must use an algorithm with a time complexity of O(log n).
This is an ordinary binary search. When ...
Posted by s2day on Fri, 18 Feb 2022 01:46:10 +0100
Implementation of improved patchwork algorithm for digital watermarking
1, Algorithm principle
1. Reference papers
Sweet rain, Yang Yu Improved Patchwork watermarking algorithm based on transform domain [J] Journal of Chengdu University of information engineering, 2017,32 (06): 623-627
2. Theoretical basis
(1) Discrete cosine transform
In the watermarking algorithm, the transform domain of the image is introdu ...
Posted by forced4 on Thu, 17 Feb 2022 23:09:22 +0100