资源简介
作为图论的大作业,我选择了2007年全国数学建模大赛的B题,里面有源代码和可执行文件,欢迎分享,对于题目我略有改动~

代码片段和文件信息
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Traffic
{
public class Arc
{
public string Name;//线路名称
public int TChange;//换乘时间
public int TDrive;//行驶时间
public int Price;//费用
public Arc next;//连接相同两个点的下一条边
public Arc()
{
this.next = null;
}
public Arc(string m_name int m_TChange int m_TDrive int m_Price)
{
this.Name = m_name;
this.TChange = m_TChange;
this.TDrive = m_TDrive;
this.Price = m_Price;
this.next = null;
}
public Arc CopyArc()
{
Arc anew = new Arc(this.Name this.TChange this.TDrive this.Price);
return anew;
}
//添加重边
public void AddTail(Arc mTemp)
{
Arc a = this;
if (mTemp.TChange >= a.TChange && mTemp.TDrive >= a.TDrive && mTemp.Price >= a.Price)
return;
if (mTemp.TChange <= a.TChange && mTemp.TDrive <= a.TDrive && mTemp.Price <= a.Price)
{
a.TChange = mTemp.TChange;
a.TDrive = mTemp.TDrive;
a.Price = mTemp.Price;
return;
}
Arc b = a.next;
while (b != null)
{
if (mTemp.TChange >= b.TChange && mTemp.TDrive >= b.TDrive && mTemp.Price >= b.Price)
return;
if (mTemp.TChange < b.TChange && mTemp.TDrive < b.TDrive && mTemp.Price < b.Price)
{
b.TChange = mTemp.TChange;
b.TDrive = mTemp.TDrive;
b.Price = mTemp.Price;
return;
}
a = b;
b = b.next;
}
a.next = mTemp;
}
//取该弧关联的两点之间的最小费用
public void LeastPrice(ref int[][] minPrice ref int[][] minTime ref string[][]chooseName int start int end)
{
minPrice[start][end] = this.Price;
chooseName[start][end] = this.Name;
minTime[start][end] = this.Price > 0 ? this.TDrive : this.TChange;
Arc temp = this.next;
while (temp != null)
{
if (minPrice[start][end] > temp.Price)
{
minPrice[start][end] = temp.Price;
chooseName[start][end] = temp.Name;
minTime[start][end] = temp.Price > 0 ? temp.TDrive : temp.TChange;
}
temp = temp.next;
}
}
//取该弧关联的两点之间最短可达的时间
public void LeastTime(ref int[][] minPrice ref int[][] minTime ref string[][] chooseName int start int end)
{
minTime[start][end] = this.Price > 0 ? this.TDrive : this.TChange;
chooseName[star
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 3688 2010-07-06 18:34 源代码\Arc.cs
文件 33328 2010-07-06 22:46 源代码\Form1.cs
文件 177183 2010-07-03 12:44 可执行文件\11BusLineInfo.txt
文件 182 2010-07-01 18:35 可执行文件\12RailLineInfo.txt
文件 568 2010-07-01 18:35 可执行文件\21T1.txt
文件 473 2010-07-01 18:36 可执行文件\22T2.txt
文件 252416 2010-07-07 13:22 可执行文件\Traffic.exe
目录 0 2010-07-11 00:20 源代码
目录 0 2010-07-11 00:20 可执行文件
----------- --------- ---------- ----- ----
467838 9
相关资源
- bp神经网络源代码,可直接运行
- 随机森林R语言代码
- 计算机图形学 边填充算法实现代码
- 直流无刷电机方波驱动 stm32 例程代码
- 仿知乎界面小程序源代码
- 贪吃蛇源代码.fla
- 周立功开发板ProASIC3实验-syn_FIFO代码
- IMX385驱动代码.zip
- dotnet 写字板 实验 源代码 不好请要不
- 数学建模实验报告(八个全)
- 图像二维小波变换的实现源代码
- 八三编码器设计 VHDL代码 简单,包附
- linux应用层的华容道游戏源代码
- 交通咨询模拟系统完整代码
- http请求状态代码
- 数值分析所有实验代码
- 网上拍卖系统完整源代码
- 音乐代码转换软件 单片机编程时用
- CSMA/CD等动画演示加源代码
- silicon lab公司的收音IC SI47XX全套开发工
- 用51单片机实现G代码翻译
- 合同管理系统的源代码(附数据库)
- 用VC 编写的仿QQ聊天室程序源代码
- web班级网站设计代码
- 38k单片机红外发送代码、keil
- STM32F103 串口程序(完整版)
- 网络唤醒代码
- VPC3_DPV1源代码,Profibus
- PB做的托盘程序(最小化后在左下角显
- RSA算法源码
评论
共有 条评论