随笔分类 -  数据结构与算法

1 2 下一页

萤火虫算法-python实现
摘要:FAIndividual.py 1 import numpy as np 2 import ObjFunction 3 4 5 class FAIndividual: 6 7 ''' 8 individual of firefly algorithm 9 '''10 1... 阅读全文

posted @ 2015-10-09 22:23 Alex Yu 阅读(8340) 评论(5) 推荐(3)

进化策略-python实现
摘要:ESIndividual.py 1 import numpy as np 2 import ObjFunction 3 4 5 class ESIndividual: 6 7 ''' 8 individual of evolutionary strategy 9 '''... 阅读全文

posted @ 2015-10-09 22:18 Alex Yu 阅读(3140) 评论(0) 推荐(0)

和声搜索算法-python实现
摘要:HSIndividual.py 1 import numpy as np 2 import ObjFunction 3 4 5 class HSIndividual: 6 7 ''' 8 individual of harmony search algorithm 9 ... 阅读全文

posted @ 2015-10-06 22:45 Alex Yu 阅读(5184) 评论(1) 推荐(0)

克隆选择算法-python实现
摘要:CSAIndividual.py 1 import numpy as np 2 import ObjFunction 3 4 5 class CSAIndividual: 6 7 ''' 8 individual of clone selection algorithm 9 ... 阅读全文

posted @ 2015-10-06 22:42 Alex Yu 阅读(4348) 评论(1) 推荐(0)

细菌觅食算法-python实现
摘要:BFOIndividual.py 1 import numpy as np 2 import ObjFunction 3 4 5 class BFOIndividual: 6 7 ''' 8 individual of baterial clony foraging algor... 阅读全文

posted @ 2015-10-06 22:39 Alex Yu 阅读(3553) 评论(2) 推荐(1)

蝙蝠算法-python实现
摘要:BAIndividual.py 1 import numpy as np 2 import ObjFunction 3 4 5 class BAIndividual: 6 7 ''' 8 individual of bat algorithm 9 '''10 11 ... 阅读全文

posted @ 2015-10-06 22:37 Alex Yu 阅读(5167) 评论(4) 推荐(0)

人工免疫算法-python实现
摘要:AIAIndividual.py 1 import numpy as np 2 import ObjFunction 3 4 5 class AIAIndividual: 6 7 ''' 8 individual of artificial immune algorithm 9... 阅读全文

posted @ 2015-10-06 22:35 Alex Yu 阅读(5517) 评论(2) 推荐(0)

人工鱼群算法-python实现
摘要:AFSIndividual.py 1 import numpy as np 2 import ObjFunction 3 import copy 4 5 6 class AFSIndividual: 7 8 """class for AFSIndividual""" 9 10 ... 阅读全文

posted @ 2015-10-06 22:33 Alex Yu 阅读(7220) 评论(1) 推荐(5)

人工蜂群算法-python实现
摘要:ABSIndividual.py 1 import numpy as np 2 import ObjFunction 3 4 5 class ABSIndividual: 6 7 ''' 8 individual of artificial bee swarm algorith... 阅读全文

posted @ 2015-10-06 22:30 Alex Yu 阅读(9554) 评论(8) 推荐(1)

差分进化算法-python实现
摘要:DEIndividual.py 1 import numpy as np 2 import ObjFunction 3 4 5 class DEIndividual: 6 7 ''' 8 individual of differential evolution algorith... 阅读全文

posted @ 2015-10-06 22:25 Alex Yu 阅读(9093) 评论(8) 推荐(2)

简单遗传算法-python实现
摘要:ObjFunction.py 1 import math 2 3 4 def GrieFunc(vardim, x, bound): 5 """ 6 Griewangk function 7 """ 8 s1 = 0. 9 s2 = 1.10 fo... 阅读全文

posted @ 2015-10-06 22:21 Alex Yu 阅读(22299) 评论(6) 推荐(2)

桶排序与快速排序算法结合-python实现
摘要:1 #-*- coding: UTF-8 -*- 2 import numpy as np 3 from QuickSort import QuickSort 4 5 def BucketSort(a, n): 6 barrel = {} 7 for i in xrange(0,... 阅读全文

posted @ 2015-09-25 12:18 Alex Yu 阅读(777) 评论(0) 推荐(0)

希尔排序算法-python实现
摘要:1 #-*- coding: UTF-8 -*- 2 import numpy as np 3 4 def ShellSort(a): 5 gap = a.size / 2 6 while gap >= 1: 7 for i in xrange(gap,a.siz... 阅读全文

posted @ 2015-09-23 11:19 Alex Yu 阅读(399) 评论(0) 推荐(0)

简单桶排序算法-python实现
摘要:1 #-*- coding: UTF-8 -*- 2 import numpy as np 3 4 def BucketSort(a, n): 5 barrel = np.zeros((1, n), dtype = 'int32') 6 for i in xrange(0,a.s... 阅读全文

posted @ 2015-09-23 11:19 Alex Yu 阅读(570) 评论(0) 推荐(0)

基数排序算法-python实现
摘要:1 #-*- coding: UTF-8 -*- 2 import numpy as np 3 4 def RadixSort(a): 5 i = 0 #初始为个位排序 6 n = 1 ... 阅读全文

posted @ 2015-09-23 11:18 Alex Yu 阅读(1162) 评论(0) 推荐(0)

归并排序算法-python实现
摘要:1 #-*- coding: UTF-8 -*- 2 import numpy as np 3 4 def Merge(a, f, m, l): 5 i = f 6 j = m + 1 7 tmp = [] 8 while i <= m and j <= l: 9... 阅读全文

posted @ 2015-09-23 11:17 Alex Yu 阅读(339) 评论(0) 推荐(0)

堆排序算法-python实现
摘要:1 #-*- coding: UTF-8 -*- 2 import numpy as np 3 4 def MakeHeap(a): 5 for i in xrange(a.size / 2 - 1, -1, -1):#对非叶子节点的子节点进行调节,构建堆 6 Adjus... 阅读全文

posted @ 2015-09-23 11:16 Alex Yu 阅读(728) 评论(0) 推荐(0)

插入排序算法-python实现
摘要:1 #-*- coding: UTF-8 -*- 2 import numpy as np 3 4 def InsertSort(a): 5 for i in xrange(1,a.size): 6 for j in xrange(i,0, -1): 7 ... 阅读全文

posted @ 2015-09-23 11:15 Alex Yu 阅读(329) 评论(0) 推荐(0)

冒泡排序算法-Python实现
摘要:1 #-*- coding: UTF-8 -*- 2 import numpy as np 3 def BubbleSort(a): 4 for i in xrange(0, a.size): 5 for j in xrange(i,a.size): 6 ... 阅读全文

posted @ 2015-09-23 11:14 Alex Yu 阅读(421) 评论(0) 推荐(0)

选择排序算法-python实现
摘要:1 #-*- coding: UTF-8 -*- 2 import numpy as np 3 def SelectSort(a): 4 for i in xrange(0,a.size): 5 min = a[i] 6 p = i 7 fo... 阅读全文

posted @ 2015-09-23 11:13 Alex Yu 阅读(285) 评论(0) 推荐(0)

1 2 下一页

导航