• c语言算法练习题 > 解TSP问题的遗传算法C语言程序
  • 解TSP问题的遗传算法C语言程序

    免费下载 下载该文档 文档格式:DOC   更新时间:2005-11-01   下载次数:0   点击次数:2
    文档基本属性
    文档语言:Simplified Chinese
    文档格式:doc
    文档作者:lanway
    关键词:
    主题:
    备注:
    点击这里显示更多文档属性
    解TSP问题的遗传算法C语言程序
    #include
    #include
    #include
    #include
    #include
    #include
    #include
    #include
    #include
    #define maxpop 100
    #define maxstring 100
    struct pp{unsigned char chrom[maxstring];
    float x,fitness;
    unsigned int parent1,parent2,xsite;
    };
    struct pp *oldpop,*newpop,*p1;
    unsigned int popsize,lchrom,gem,maxgen,co_min,jrand;
    unsigned int nmutation,ncross,jcross,maxpp,minpp,maxxy;
    float pcross,pmutation,sumfitness,avg,max,min,seed,maxold,oldrand[maxstring];
    unsigned char x[maxstring],y[maxstring];
    float *dd,ff,maxdd,refpd,fm[201];
    FILE *fp,*fp1;
    float objfunc(float);
    void statistics();
    int select();
    int flip(float);
    int crossover();
    void generation();
    void initialize();
    void report();
    float decode();
    void crtinit();
    void inversion();
    float random1();
    void randomize1();
    main()
    {unsigned int gen,k,j,tt;
    char fname[10];
    float ttt;
    clrscr();

    下一页

  • 下载地址 (推荐使用迅雷下载地址,速度快,支持断点续传)
  • 免费下载 DOC格式下载
  • 您可能感兴趣的
  • pid算法c语言程序  c语言算法编程100例  c语言经典算法100例  c语言常用算法  c语言快速排序算法  c语言经典算法大全  c语言算法大全  c语言算法  c语言常用算法源代码