招聘網站評價
算法輪廓: (1)置M爲空 (2)找出一條增廣路徑P,通過取反操作獲得更大的匹配M’代替M (3)重複(2)操作直到找不出增廣路徑爲止 V2:
#include < iostream > #include < fstream > using namespace std; const int MAXN = 100 ; int uN, vN; // u,v數目 bool g[MAXN][MAXN]; // g[i][j] 表示 xi與yj相連 int xM[MAXN], yM[MAXN]; // 輸出量 bool chk[MAXN]; // 輔助量 檢查某輪 y[v]是否被check bool SearchPath( int u) { int v; for (v = 0 ; v < vN; v ++ ) { if (g[u][v] && ! chk[v]) { chk[v] = true ; if (yM[v] == - 1 || SearchPath(yM[v])) { yM[v] = u; xM[u] = v; return true ; } } } return false ; } int MaxMatch() { int u; int ret = 0 ; memset(xM, - 1 , sizeof (xM)); memset(yM, - 1 , sizeof (yM)); for (u = 0 ; u < uN; u ++ ) { if (xM[u] == - 1 ) { memset(chk, false , sizeof (chk)); if (SearchPath(u)) ret ++ ; } } return ret; } int main() { int i, k; int tU, tV; ifstream cin( " test.txt " ); cin >> uN >> vN >> k; memset(g, false , sizeof (g)); for (i = 0 ; i < k; i ++ ) { cin >> tU >> tV; g[tU][tV] = true ; } int M = MaxMatch(); cout << " Total Match: " << M << endl; for (i = 0 ; i < MAXN; i ++ ) if (xM[i] != - 1 ) cout << i << ' ' << xM[i] << endl; system( " pause " ); return 0 ; } /**/ /* ********** test data: 3 3 3 1 1 1 0 2 2 ********** */
強化學習概覽 This overview is largely based on this article: https://medium.com/@SmartLabAI/reinforcement-learning-algorithms
插入排序法 1.工作原理(算法思路) 新建一個指針,指針左邊的所有元素都是有序的。但是他們的位置並不是最終位置,一個指針從左向右掃描,若指針所在處的元素比左邊元素小,則將該元素向前浮動至適當位置,使指針左側元素仍然保持有序。當指針掃描到整
分治基本思想影響算法複雜度的因素經典案例1 二分檢索設計思想僞碼2 二分歸併設計思想僞碼3 漢諾塔設計思想僞碼4 快速排序設計思想僞碼實例5 快速傅里葉變換(信號平滑處理)問題描述設計&分析減少子問題個數案例:大數相乘設計思想參考
XGBoost可以用來分類,迴歸,排序。 支持多種語言:C++, Python, R, Java, Scala, Julia。 安裝 參考https://xgboost.readthedocs.io/en/latest/buil
NDCG(Normalized Discounted Cumulative Gain): 維基百科寫的很清楚。 注意理解這四個詞。 Discounted:順序影響指標。 Normalized:消除文檔個數對指標的影響。
商品關聯分析 關聯 relevance: 主要用在互聯網的內容和文檔上,比如搜索引擎算法文檔中之間的關聯性。 association: 用在實際的事物之上,比如電子商務網站上的商品之間的關聯度。 支持度(support):數據集中
簡單記錄一下關於仿真優化的一些知識點和思考。主要基於:Handbook of Simulation Optimization, Michael Fu Table of Contents Overview Discrete Optimiza
點這個: https://towardsdatascience.com/a-road-map-for-deep-learning-b9aee0b2919f
Currently learning stochastic optimization (SO) theory, I will note important content here. Some book references ar
Reading notes of the paper "Distributed Optimization and Statistical Learning via ADMM" by Boyd, Parikh, Chu, Peleato a
Source:http://www.seas.ucla.edu/~vandenbe/ee236c.html Introduction Outline First-order algorithms Decomposition and s
Overview of gradient descent algorithms An overview of gradient descent optimization algorithms Gradient descent is
function TreeNode(val) { this.val = val; this.left = this.right = null; } 解一:遞歸 先判斷樹結構是否爲null,如果是null,直接
雖然網上已經很多這種排序算法了,但是爲了讓自己更熟悉一點(也順便寫篇博客),所以準備把基本的那幾種算法原理及代碼重新寫一遍 今天先來冒泡算法吧,冒泡算法的基本原理就是通過不斷的比較兩個相鄰元素的大小,如果前一個比後一個大,則交換兩個元素的