-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLien.cs
More file actions
106 lines (96 loc) · 2.57 KB
/
Lien.cs
File metadata and controls
106 lines (96 loc) · 2.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace KC
{
internal class Lien
{
#region Attributs
static Graphe g = new Graphe();
(Noeud, Noeud) arete;
bool orientation;
bool ponderation;
int poids;
int distance;
#endregion
#region Propriete
/// <summary>
/// Constructeur naturel de la classe Lien
/// </summary>
public Lien(Noeud n , Noeud p)
{
this.arete = (n,p);
this.orientation = false;
this.ponderation = false;
this.poids = Calcul_Poids(n,p);
this.distance = 0;
}
public Lien(Noeud n )
{
this.orientation = false;
this.ponderation = false;
this.poids = 0;
this.distance = this.poids;
}
/// <summary>
/// Propirete d'une arete
/// </summary>
public (Noeud, Noeud) Arete
{
get { return this.arete; }
set { this.arete = value; }
}
/// <summary>
/// Propirete de la liste d'aretes
/// </summary>
/// <summary>
/// Propirete de l'orientation d'un graphe
/// </summary>
public bool Orientation
{
get { return this.orientation; }
}
/// <summary>
/// Propirete de la ponderation d'un graphe
/// </summary>
public bool Ponderation
{
get { return this.ponderation; }
}
/// <summary>
/// Distance d'une arete(arc)
/// </summary>
public int Distance
{
get { return this.distance; }
set { this.distance = value; }
}
/// <summary>
/// Poids d'une arete(arc)
/// </summary>
public int Poids
{
get { return this.poids; }
set { this.poids = value; }
}
#endregion
public int Calcul_Distance(Noeud a , Noeud b)
{
//Existence de Chemin entre a et b
//Calcul de distance avec le nombre de sommets renvoyes entre a et b
return this.distance;
}
public int Calcul_Poids(Noeud a , Noeud b)
{
int poids = 0;
if(g.Chemin(a, b).Item1)
{
List<int> Chemin = g.Chemin(a, b).Item2;
poids = Chemin.Count;
}
return poids;
}
}
}