diff --git a/code/instances/b.txt b/code/instances/b.txt
deleted file mode 100644
index ad8e41d666f79174724be92214995320b510c1f9..0000000000000000000000000000000000000000
--- a/code/instances/b.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-c fjfj
-p sp 6 6
-
-p sp 6 6
-a 1 2 3
-a 1 4 2
-a 1 5 3
-a 1 3 2
-a 2 4 1
-a 5 2 3
diff --git a/code/instances/hh.txt b/code/instances/hh.txt
deleted file mode 100644
index 78688e128229ba3f36bbdd4a42282330732d9c03..0000000000000000000000000000000000000000
--- a/code/instances/hh.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-c dhdfh
-p sp 4 4
-
-p sp 4 4
-a 1 2 3
-a 1 3 4
-a 1 4 1
-a 2 3 1
diff --git a/code/instances/test.txt b/code/instances/test.txt
new file mode 100644
index 0000000000000000000000000000000000000000..1ced7cc257f975b1116f7286b3245100408304cf
--- /dev/null
+++ b/code/instances/test.txt
@@ -0,0 +1,8 @@
+c hhh
+p sp 4 4
+
+p sp 4 4
+a 1 2 3
+a 1 3 3
+a 2 4 1
+a 3 4 2
diff --git a/code/instances/tests b/code/instances/tests
deleted file mode 100644
index 776df1e29cfd3a45affd7078f3319df362837c3e..0000000000000000000000000000000000000000
--- a/code/instances/tests
+++ /dev/null
@@ -1,6 +0,0 @@
-c ggg
-p sp 4 2
-
-p sp 4 2
-a 1 2 3
-a 3 1 2
diff --git a/code/rendu/RapportSAE202.txt b/code/rendu/RapportSAE202.txt
new file mode 100644
index 0000000000000000000000000000000000000000..4c50655f97445c48389cf8bab15e2fa9ffbffa2c
--- /dev/null
+++ b/code/rendu/RapportSAE202.txt
@@ -0,0 +1,69 @@
+Rapport SAE 2.02
+
+Introduction
+
+Dans le cadre de ce rapport, nous souhaitons exposer la manière dont nous avons appréhendé la gestion des accès aux sommets au sein d'un graphe orienté, dans un contexte pondéré, en nous concentrant notamment sur la prise en charge des sommets inexistants. Cette considération s'avère cruciale afin d'assurer la robustesse et la fiabilité de notre implémentation en TypeScript.
+
+Gestion des Sommets Inexistants
+
+Ajout d'un Arc
+
+Lorsqu'un utilisateur tente d'ajouter un arc entre des sommets qui ne sont pas répertoriés, nous avons adopté deux approches principales :
+
+1. Création Automatique des Sommets : Si l'option de création automatique des sommets est activée, les sommets source et destination sont instanciés automatiquement avant d'ajouter l'arc avec le poids spécifié. Cette méthode garantit la réussite de l'opération même en l'absence de définition préalable des sommets.
+
+2. Levée d'une Exception : Si l'option de création automatique des sommets n'est pas activée, une exception explicite est émise. Cette démarche notifie l'utilisateur de l'inexistence des sommets spécifiés, interdisant par conséquent l'ajout de l'arc. Il revient alors à l'utilisateur de créer manuellement les sommets avant de réitérer l'opération.
+
+Suppression d'un Sommet ou d'un Arc
+
+Pour la suppression de sommets ou d'arcs, la prise en charge des sommets inexistants revêt également une importance capitale :
+
+1. Suppression d'un Sommet : Si l'utilisateur tente de supprimer un sommet qui n'existe pas, une exception est déclenchée. Cette anomalie indique à l'utilisateur que le sommet spécifié est inexistant, rendant ainsi l'opération invalide.
+
+2. Suppression d'un Arc : Dans le cas où l'utilisateur essaie de supprimer un arc entre des sommets inexistants ou un arc qui n'existe pas, une exception est également levée. Cette procédure assure que seules les opérations légitimes sont exécutées sur le graphe.
+
+Vérification de l'Existence d'un Arc
+
+Lorsqu'il s'agit de vérifier l'existence d'un arc entre deux sommets, nous avons mis en place un mécanisme afin de prendre en charge les sommets inexistants :
+
+- Vérification de l'Existence d'un Arc : Préalablement à la vérification de l'existence d'un arc, nous nous assurons que les sommets source et destination sont présents dans le graphe. Si l'un des sommets fait défaut, une valeur signifiant l'absence de l'arc est retournée.
+
+Récupération de Poids et de Voisins
+
+La récupération des poids des arcs et des voisins des sommets nécessite également une prise en charge des sommets inexistants :
+
+1. Récupération du Poids d'un Arc : Avant de récupérer le poids d'un arc, nous vérifions l'existence des sommets source et destination. En cas d'absence d'un des sommets, une valeur indiquant l'inexistence de l'arc est retournée.
+
+2. Récupération des Voisins : Pour récupérer les voisins d'un sommet, une vérification préalable de l'existence du sommet est effectuée. Si le sommet est absent, une liste vide est retournée, témoignant de l'absence de voisins.
+
+Tests Unitaires avec Jest
+
+Fonctionnalités de Jest
+
+Jest constitue un framework de test largement utilisé, permettant l'écriture et l'exécution de tests unitaires pour du code JavaScript et TypeScript. Il offre une interface claire pour la définition de tests et d'assertions, vérifiant ainsi la conformité du code aux attentes. Jest se distingue notamment par sa facilité d'utilisation et ses fonctionnalités intégrées, simplifiant la gestion des tests.
+
+Utilisation de Jest pour les Tests Unitaires
+
+Avec Jest, il est possible de :
+
+- crire des Tests Unitaires : Jest autorise la création de tests pour chaque fonction du projet, permettant ainsi de vérifier que chaque fonction produit les résultats escomptés pour diverses données d'entrée.
+
+- **Exécuter les Tests : Jest exécute l'ensemble des tests définis dans le projet, générant un rapport détaillé indiquant les tests réussis et échoués. Cette fonctionnalité permet de vérifier rapidement l'intégrité du code.
+
+- Automatiser les Tests : Jest peut être intégré à des pipelines d'intégration continue, automatisant ainsi l'exécution des tests à chaque modification du code. Cette pratique contribue à la détection précoce des erreurs, favorisant la stabilité du code.
+
+Avantages de Jest pour Notre Projet
+
+Pour notre projet de graphe orienté pondéré, l'utilisation de Jest offre plusieurs avantages :
+
+- Validation des Fonctionnalités : En rédigeant des tests unitaires, nous nous assurons du bon fonctionnement des fonctionnalités essentielles, telles que l'ajout et la suppression de sommets et d'arcs.
+
+- Détection Précoce des Erreurs : Les tests unitaires facilitent l'identification des erreurs introduites lors du développement, limitant ainsi les risques de dysfonctionnements en production.
+
+- Facilité de Maintenance : Grâce à une suite de tests bien définie, nous sommes en mesure de refondre notre code en toute confiance, les tests alertant de toute régression ou comportement imprévu.
+
+Il convient de noter que Deno, une alternative à Node.js, ne prend pas en charge les modules de système de fichiers (fs) utilisés pour la lecture et l'écriture de fichiers dans notre projet. Jest s'avère donc plus adapté à notre environnement de développement basé sur TypeScript/Node.js.
+
+Conclusion
+
+En conclusion, la prise en charge des sommets inexistants constitue un aspect essentiel de notre implémentation du graphe orienté pondéré en TypeScript. En adoptant des stratégies telles que la création automatique, la levée d'exceptions et la vérification préalable, nous garantissons la robustesse et la fiabilité de notre système, capable de gérer efficacement les erreurs potentielles liées aux opérations sur des sommets inexistants. Pour assurer la qualité de notre implémentation, nous avons recours à Jest pour effectuer des tests unitaires, nous permettant ainsi de vérifier que chaque composant de notre code fonctionne correctement dans divers scénarios
diff --git a/code/rendu/UML_GrapheOrientePondere.webp b/code/rendu/UML_GrapheOrientePondere.webp
new file mode 100644
index 0000000000000000000000000000000000000000..ff6dbba36f679011b965e25248e1dd026aef5b58
Binary files /dev/null and b/code/rendu/UML_GrapheOrientePondere.webp differ
diff --git "a/code/rendu/UML_R\303\251sultat.webp" "b/code/rendu/UML_R\303\251sultat.webp"
new file mode 100644
index 0000000000000000000000000000000000000000..39e34a727e5c3d11ac1ce9124cc29f92df538486
Binary files /dev/null and "b/code/rendu/UML_R\303\251sultat.webp" differ
diff --git a/code/src/GrapheOrientePondere.js b/code/src/GrapheOrientePondere.js
index f267b07e30ad0e5ae91ee091843a4f912dc9568c..c8ca670f2540a2f6a20aba36ba0c1596bb8e4ed6 100644
--- a/code/src/GrapheOrientePondere.js
+++ b/code/src/GrapheOrientePondere.js
@@ -3,9 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
 exports.GrapheOrientePondere = void 0;
 const fs_1 = require("fs");
 class GrapheOrientePondere {
-    constructor(fichier) {
+    constructor(utiliserListeAdjacence = true, fichier) {
+        this.utiliserListeAdjacence = utiliserListeAdjacence;
         this.listeAdjacence = new Map();
-        this.utiliserListeAdjacence = true; // Par défaut, utiliser la liste d'adjacence
+        this.matriceAdjacence = [];
         this.commentaire = '';
         this.infoGraphe = '';
         if (fichier) {
@@ -16,68 +17,133 @@ class GrapheOrientePondere {
         this.utiliserListeAdjacence = utiliser;
     }
     redimensionnerSommets(n) {
-        while (this.listeAdjacence.size > n) {
-            const sommet = this.listeAdjacence.size - 1;
-            this.listeAdjacence.delete(sommet);
-            this.listeAdjacence.forEach((val) => val.delete(sommet));
+        if (this.utiliserListeAdjacence) {
+            while (this.listeAdjacence.size > n) {
+                const sommet = this.listeAdjacence.size - 1;
+                this.listeAdjacence.delete(sommet);
+                this.listeAdjacence.forEach((val) => val.delete(sommet));
+            }
+            while (this.listeAdjacence.size < n) {
+                this.listeAdjacence.set(this.listeAdjacence.size, new Map());
+            }
         }
-        while (this.listeAdjacence.size < n) {
-            this.listeAdjacence.set(this.listeAdjacence.size, new Map());
+        else {
+            this.matriceAdjacence = this.matriceAdjacence.slice(0, n);
+            for (let i = 0; i < n; i++) {
+                if (!this.matriceAdjacence[i]) {
+                    this.matriceAdjacence[i] = new Array(n).fill(Infinity);
+                }
+                else {
+                    this.matriceAdjacence[i] = this.matriceAdjacence[i].slice(0, n);
+                }
+            }
         }
         this.mettreAJourInfosGraphe();
     }
     nombreSommets() {
-        return this.listeAdjacence.size;
+        return this.utiliserListeAdjacence ? this.listeAdjacence.size : this.matriceAdjacence.length;
     }
     nombreArcs() {
-        let count = 0;
-        this.listeAdjacence.forEach(val => count += val.size);
-        return count;
+        if (this.utiliserListeAdjacence) {
+            let count = 0;
+            this.listeAdjacence.forEach(val => count += val.size);
+            return count;
+        }
+        else {
+            let count = 0;
+            for (let i = 0; i < this.matriceAdjacence.length; i++) {
+                for (let j = 0; j < this.matriceAdjacence[i].length; j++) {
+                    if (this.matriceAdjacence[i][j] < Infinity)
+                        count++;
+                }
+            }
+            return count;
+        }
     }
     ajouterArc(src, dest, poids) {
         var _a;
-        if (!this.listeAdjacence.has(src)) {
-            this.listeAdjacence.set(src, new Map());
+        if (this.utiliserListeAdjacence) {
+            if (!this.listeAdjacence.has(src)) {
+                this.listeAdjacence.set(src, new Map());
+            }
+            (_a = this.listeAdjacence.get(src)) === null || _a === void 0 ? void 0 : _a.set(dest, poids);
+        }
+        else {
+            this.matriceAdjacence[src][dest] = poids;
         }
-        (_a = this.listeAdjacence.get(src)) === null || _a === void 0 ? void 0 : _a.set(dest, poids);
         this.mettreAJourInfosGraphe();
     }
     retirerArc(src, dest) {
         var _a, _b;
-        if (!this.listeAdjacence.has(src) || !((_a = this.listeAdjacence.get(src)) === null || _a === void 0 ? void 0 : _a.has(dest))) {
-            console.log("L'arc n'existe pas");
-            return;
+        if (this.utiliserListeAdjacence) {
+            if (!this.listeAdjacence.has(src) || !((_a = this.listeAdjacence.get(src)) === null || _a === void 0 ? void 0 : _a.has(dest))) {
+                console.log("L'arc n'existe pas");
+                return;
+            }
+            (_b = this.listeAdjacence.get(src)) === null || _b === void 0 ? void 0 : _b.delete(dest);
+        }
+        else {
+            if (this.matriceAdjacence[src][dest] === Infinity) {
+                console.log("L'arc n'existe pas");
+                return;
+            }
+            this.matriceAdjacence[src][dest] = Infinity;
         }
-        (_b = this.listeAdjacence.get(src)) === null || _b === void 0 ? void 0 : _b.delete(dest);
         this.mettreAJourInfosGraphe();
     }
     testerArc(src, dest) {
         var _a, _b;
-        return this.listeAdjacence.has(src) && ((_b = (_a = this.listeAdjacence.get(src)) === null || _a === void 0 ? void 0 : _a.has(dest)) !== null && _b !== void 0 ? _b : false);
+        if (this.utiliserListeAdjacence) {
+            return this.listeAdjacence.has(src) && ((_b = (_a = this.listeAdjacence.get(src)) === null || _a === void 0 ? void 0 : _a.has(dest)) !== null && _b !== void 0 ? _b : false);
+        }
+        else {
+            return this.matriceAdjacence[src][dest] < Infinity;
+        }
     }
     recupererPoids(src, dest) {
         var _a;
-        return (_a = this.listeAdjacence.get(src)) === null || _a === void 0 ? void 0 : _a.get(dest);
+        if (this.utiliserListeAdjacence) {
+            return (_a = this.listeAdjacence.get(src)) === null || _a === void 0 ? void 0 : _a.get(dest);
+        }
+        else {
+            return this.matriceAdjacence[src][dest];
+        }
     }
     recupererSuccesseurs(sommet) {
         var _a;
-        return Array.from(((_a = this.listeAdjacence.get(sommet)) === null || _a === void 0 ? void 0 : _a.keys()) || []);
+        if (this.utiliserListeAdjacence) {
+            return Array.from(((_a = this.listeAdjacence.get(sommet)) === null || _a === void 0 ? void 0 : _a.keys()) || []);
+        }
+        else {
+            const successeurs = [];
+            for (let i = 0; i < this.matriceAdjacence.length; i++) {
+                if (this.matriceAdjacence[sommet][i] < Infinity) {
+                    successeurs.push(i);
+                }
+            }
+            return successeurs;
+        }
     }
     recupererPredecesseurs(sommet) {
         const predecesseurs = [];
-        this.listeAdjacence.forEach((val, key) => {
-            if (val.has(sommet)) {
-                predecesseurs.push(key);
+        if (this.utiliserListeAdjacence) {
+            this.listeAdjacence.forEach((val, key) => {
+                if (val.has(sommet)) {
+                    predecesseurs.push(key);
+                }
+            });
+        }
+        else {
+            for (let i = 0; i < this.matriceAdjacence.length; i++) {
+                if (this.matriceAdjacence[i][sommet] < Infinity) {
+                    predecesseurs.push(i);
+                }
             }
-        });
+        }
         return predecesseurs;
     }
     recupererVoisins(sommet) {
-        const successeurs = this.recupererSuccesseurs(sommet);
-        const predecesseurs = this.recupererPredecesseurs(sommet);
-        const voisins = Array.from(new Set([...successeurs, ...predecesseurs]));
-        console.log(`Sommet: ${sommet}, Successeurs: ${successeurs}, Prédécesseurs: ${predecesseurs}, Voisins: ${voisins}`);
-        return voisins;
+        return [...new Set([...this.recupererSuccesseurs(sommet), ...this.recupererPredecesseurs(sommet)])];
     }
     sauvegarderGraphe(output) {
         let stream;
@@ -89,11 +155,22 @@ class GrapheOrientePondere {
         }
         stream.write(`${this.commentaire}\n`);
         stream.write(`${this.infoGraphe}\n`);
-        this.listeAdjacence.forEach((val, src) => {
-            val.forEach((poids, dest) => {
-                stream.write(`a ${src} ${dest} ${poids}\n`);
+        if (this.utiliserListeAdjacence) {
+            this.listeAdjacence.forEach((val, src) => {
+                val.forEach((poids, dest) => {
+                    stream.write(`a ${src} ${dest} ${poids}\n`);
+                });
             });
-        });
+        }
+        else {
+            for (let i = 0; i < this.matriceAdjacence.length; i++) {
+                for (let j = 0; j < this.matriceAdjacence[i].length; j++) {
+                    if (this.matriceAdjacence[i][j] < Infinity) {
+                        stream.write(`a ${i} ${j} ${this.matriceAdjacence[i][j]}\n`);
+                    }
+                }
+            }
+        }
         if (typeof output === 'string') {
             stream.end();
         }
@@ -126,7 +203,12 @@ class GrapheOrientePondere {
         return this.infoGraphe;
     }
     sommetExiste(sommet) {
-        return this.listeAdjacence.has(sommet);
+        if (this.utiliserListeAdjacence) {
+            return this.listeAdjacence.has(sommet);
+        }
+        else {
+            return sommet >= 0 && sommet < this.matriceAdjacence.length;
+        }
     }
     ajouterSommet() {
         const newSommet = this.nombreSommets();
@@ -135,8 +217,16 @@ class GrapheOrientePondere {
     }
     supprimerSommet(sommet) {
         if (this.sommetExiste(sommet)) {
-            this.listeAdjacence.delete(sommet);
-            this.listeAdjacence.forEach((val) => val.delete(sommet));
+            if (this.utiliserListeAdjacence) {
+                this.listeAdjacence.delete(sommet);
+                this.listeAdjacence.forEach((val) => val.delete(sommet));
+            }
+            else {
+                for (let i = 0; i < this.matriceAdjacence.length; i++) {
+                    this.matriceAdjacence[i][sommet] = Infinity;
+                    this.matriceAdjacence[sommet][i] = Infinity;
+                }
+            }
             this.mettreAJourInfosGraphe();
         }
         else {
diff --git a/code/src/GrapheOrientePondere.ts b/code/src/GrapheOrientePondere.ts
index b9d05c1d889337ac858762ee757cc5f47a5a07a1..ac66626cb0e0cde1064b048ef8eb33c8de9aa831 100644
--- a/code/src/GrapheOrientePondere.ts
+++ b/code/src/GrapheOrientePondere.ts
@@ -1,14 +1,16 @@
-import { readFileSync, writeFileSync, createWriteStream, WriteStream } from 'fs';
+import { readFileSync, createWriteStream, WriteStream } from 'fs';
 
 export class GrapheOrientePondere {
     private listeAdjacence: Map<number, Map<number, number>>;
+    private matriceAdjacence: number[][];
     private utiliserListeAdjacence: boolean;
     private commentaire: string;
     private infoGraphe: string;
 
-    constructor(fichier?: string) {
+    constructor(utiliserListeAdjacence: boolean = true, fichier?: string) {
+        this.utiliserListeAdjacence = utiliserListeAdjacence;
         this.listeAdjacence = new Map();
-        this.utiliserListeAdjacence = true; // Par défaut, utiliser la liste d'adjacence
+        this.matriceAdjacence = [];
         this.commentaire = '';
         this.infoGraphe = '';
 
@@ -22,72 +24,127 @@ export class GrapheOrientePondere {
     }
 
     redimensionnerSommets(n: number) {
-        while (this.listeAdjacence.size > n) {
-            const sommet = this.listeAdjacence.size - 1;
-            this.listeAdjacence.delete(sommet);
-            this.listeAdjacence.forEach((val) => val.delete(sommet));
-        }
-        while (this.listeAdjacence.size < n) {
-            this.listeAdjacence.set(this.listeAdjacence.size, new Map());
+        if (this.utiliserListeAdjacence) {
+            while (this.listeAdjacence.size > n) {
+                const sommet = this.listeAdjacence.size - 1;
+                this.listeAdjacence.delete(sommet);
+                this.listeAdjacence.forEach((val) => val.delete(sommet));
+            }
+            while (this.listeAdjacence.size < n) {
+                this.listeAdjacence.set(this.listeAdjacence.size, new Map());
+            }
+        } else {
+            this.matriceAdjacence = this.matriceAdjacence.slice(0, n);
+            for (let i = 0; i < n; i++) {
+                if (!this.matriceAdjacence[i]) {
+                    this.matriceAdjacence[i] = new Array(n).fill(Infinity);
+                } else {
+                    this.matriceAdjacence[i] = this.matriceAdjacence[i].slice(0, n);
+                }
+            }
         }
         this.mettreAJourInfosGraphe();
     }
 
     nombreSommets(): number {
-        return this.listeAdjacence.size;
+        return this.utiliserListeAdjacence ? this.listeAdjacence.size : this.matriceAdjacence.length;
     }
 
     nombreArcs(): number {
-        let count = 0;
-        this.listeAdjacence.forEach(val => count += val.size);
-        return count;
+        if (this.utiliserListeAdjacence) {
+            let count = 0;
+            this.listeAdjacence.forEach(val => count += val.size);
+            return count;
+        } else {
+            let count = 0;
+            for (let i = 0; i < this.matriceAdjacence.length; i++) {
+                for (let j = 0; j < this.matriceAdjacence[i].length; j++) {
+                    if (this.matriceAdjacence[i][j] < Infinity) count++;
+                }
+            }
+            return count;
+        }
     }
 
     ajouterArc(src: number, dest: number, poids: number) {
-        if (!this.listeAdjacence.has(src)) {
-            this.listeAdjacence.set(src, new Map());
+        if (this.utiliserListeAdjacence) {
+            if (!this.listeAdjacence.has(src)) {
+                this.listeAdjacence.set(src, new Map());
+            }
+            this.listeAdjacence.get(src)?.set(dest, poids);
+        } else {
+            this.matriceAdjacence[src][dest] = poids;
         }
-        this.listeAdjacence.get(src)?.set(dest, poids);
         this.mettreAJourInfosGraphe();
     }
 
     retirerArc(src: number, dest: number) {
-        if (!this.listeAdjacence.has(src) || !this.listeAdjacence.get(src)?.has(dest)) {
-            console.log("L'arc n'existe pas");
-            return;
+        if (this.utiliserListeAdjacence) {
+            if (!this.listeAdjacence.has(src) || !this.listeAdjacence.get(src)?.has(dest)) {
+                console.log("L'arc n'existe pas");
+                return;
+            }
+            this.listeAdjacence.get(src)?.delete(dest);
+        } else {
+            if (this.matriceAdjacence[src][dest] === Infinity) {
+                console.log("L'arc n'existe pas");
+                return;
+            }
+            this.matriceAdjacence[src][dest] = Infinity;
         }
-        this.listeAdjacence.get(src)?.delete(dest);
         this.mettreAJourInfosGraphe();
     }
 
     testerArc(src: number, dest: number): boolean {
-        return this.listeAdjacence.has(src) && (this.listeAdjacence.get(src)?.has(dest) ?? false);
+        if (this.utiliserListeAdjacence) {
+            return this.listeAdjacence.has(src) && (this.listeAdjacence.get(src)?.has(dest) ?? false);
+        } else {
+            return this.matriceAdjacence[src][dest] < Infinity;
+        }
     }
 
     recupererPoids(src: number, dest: number): number | undefined {
-        return this.listeAdjacence.get(src)?.get(dest);
+        if (this.utiliserListeAdjacence) {
+            return this.listeAdjacence.get(src)?.get(dest);
+        } else {
+            return this.matriceAdjacence[src][dest];
+        }
     }
 
     recupererSuccesseurs(sommet: number): number[] {
-        return Array.from(this.listeAdjacence.get(sommet)?.keys() || []);
+        if (this.utiliserListeAdjacence) {
+            return Array.from(this.listeAdjacence.get(sommet)?.keys() || []);
+        } else {
+            const successeurs: number[] = [];
+            for (let i = 0; i < this.matriceAdjacence.length; i++) {
+                if (this.matriceAdjacence[sommet][i] < Infinity) {
+                    successeurs.push(i);
+                }
+            }
+            return successeurs;
+        }
     }
 
     recupererPredecesseurs(sommet: number): number[] {
         const predecesseurs: number[] = [];
-        this.listeAdjacence.forEach((val, key) => {
-            if (val.has(sommet)) {
-                predecesseurs.push(key);
+        if (this.utiliserListeAdjacence) {
+            this.listeAdjacence.forEach((val, key) => {
+                if (val.has(sommet)) {
+                    predecesseurs.push(key);
+                }
+            });
+        } else {
+            for (let i = 0; i < this.matriceAdjacence.length; i++) {
+                if (this.matriceAdjacence[i][sommet] < Infinity) {
+                    predecesseurs.push(i);
+                }
             }
-        });
+        }
         return predecesseurs;
     }
 
     recupererVoisins(sommet: number): number[] {
-        const successeurs = this.recupererSuccesseurs(sommet);
-        const predecesseurs = this.recupererPredecesseurs(sommet);
-        const voisins = Array.from(new Set([...successeurs, ...predecesseurs]));
-        console.log(`Sommet: ${sommet}, Successeurs: ${successeurs}, Prédécesseurs: ${predecesseurs}, Voisins: ${voisins}`);
-        return voisins;
+        return [...new Set([...this.recupererSuccesseurs(sommet), ...this.recupererPredecesseurs(sommet)])];
     }
 
     sauvegarderGraphe(output: WriteStream | string) {
@@ -101,11 +158,21 @@ export class GrapheOrientePondere {
         stream.write(`${this.commentaire}\n`);
         stream.write(`${this.infoGraphe}\n`);
 
-        this.listeAdjacence.forEach((val, src) => {
-            val.forEach((poids, dest) => {
-                stream.write(`a ${src} ${dest} ${poids}\n`);
+        if (this.utiliserListeAdjacence) {
+            this.listeAdjacence.forEach((val, src) => {
+                val.forEach((poids, dest) => {
+                    stream.write(`a ${src} ${dest} ${poids}\n`);
+                });
             });
-        });
+        } else {
+            for (let i = 0; i < this.matriceAdjacence.length; i++) {
+                for (let j = 0; j < this.matriceAdjacence[i].length; j++) {
+                    if (this.matriceAdjacence[i][j] < Infinity) {
+                        stream.write(`a ${i} ${j} ${this.matriceAdjacence[i][j]}\n`);
+                    }
+                }
+            }
+        }
 
         if (typeof output === 'string') {
             stream.end();
@@ -142,7 +209,11 @@ export class GrapheOrientePondere {
     }
 
     sommetExiste(sommet: number): boolean {
-        return this.listeAdjacence.has(sommet);
+        if (this.utiliserListeAdjacence) {
+            return this.listeAdjacence.has(sommet);
+        } else {
+            return sommet >= 0 && sommet < this.matriceAdjacence.length;
+        }
     }
 
     ajouterSommet(): number {
@@ -153,8 +224,15 @@ export class GrapheOrientePondere {
 
     supprimerSommet(sommet: number) {
         if (this.sommetExiste(sommet)) {
-            this.listeAdjacence.delete(sommet);
-            this.listeAdjacence.forEach((val) => val.delete(sommet));
+            if (this.utiliserListeAdjacence) {
+                this.listeAdjacence.delete(sommet);
+                this.listeAdjacence.forEach((val) => val.delete(sommet));
+            } else {
+                for (let i = 0; i < this.matriceAdjacence.length; i++) {
+                    this.matriceAdjacence[i][sommet] = Infinity;
+                    this.matriceAdjacence[sommet][i] = Infinity;
+                }
+            }
             this.mettreAJourInfosGraphe();
         } else {
             console.log('Sommet non existant.');
diff --git a/code/src/index.js b/code/src/index.js
index 2a28f3eed83519e8ae18926055794f45fc94ddfb..3207d4ea56ac3ceb7dc0751ccba49d760d63ce7c 100644
--- a/code/src/index.js
+++ b/code/src/index.js
@@ -42,10 +42,10 @@ function afficherMenu() {
                 menuModifierGraphe();
                 break;
             case '2':
-                creerGraphe();
+                choisirRepresentationPourCreation();
                 break;
             case '3':
-                calculerIsochrones();
+                choisirRepresentationPourCalcul();
                 break;
             case '4':
                 console.log("Au revoir !");
@@ -58,9 +58,32 @@ function afficherMenu() {
         }
     });
 }
+function choisirRepresentationPourCreation() {
+    rl.question('Voulez-vous utiliser une liste d\'adjacence (1) ou une matrice d\'adjacence (2)? ', (reponse) => {
+        if (reponse === '1' || reponse === '2') {
+            creerGraphe(reponse === '1');
+        }
+        else {
+            console.log("Option invalide. Veuillez réessayer.");
+            choisirRepresentationPourCreation();
+        }
+    });
+}
+function choisirRepresentationPourCalcul() {
+    rl.question('Voulez-vous utiliser une liste d\'adjacence (1) ou une matrice d\'adjacence (2)? ', (reponse) => {
+        if (reponse === '1' || reponse === '2') {
+            calculerIsochrones(reponse === '1');
+        }
+        else {
+            console.log("Option invalide. Veuillez réessayer.");
+            choisirRepresentationPourCalcul();
+        }
+    });
+}
 function menuModifierGraphe() {
     rl.question('Entrez le chemin du fichier de graphe à modifier: ', (chemin) => {
-        const graphe = new GrapheOrientePondere_1.GrapheOrientePondere(chemin);
+        const utiliserListeAdjacence = detecterRepresentation(chemin);
+        const graphe = new GrapheOrientePondere_1.GrapheOrientePondere(utiliserListeAdjacence, chemin); // Détecte la représentation à utiliser
         console.log("Graphe chargé.");
         afficherSousMenuModification(graphe, chemin);
     });
@@ -219,9 +242,9 @@ function afficherSousMenuModification(graphe, chemin) {
         }
     });
 }
-function creerGraphe() {
+function creerGraphe(utiliserListeAdjacence) {
     rl.question('Entrez un commentaire pour l\'instance de graphe (ligne commencée par "c"): ', (commentaire) => {
-        const graphe = new GrapheOrientePondere_1.GrapheOrientePondere();
+        const graphe = new GrapheOrientePondere_1.GrapheOrientePondere(utiliserListeAdjacence);
         let nombreSommets = 0;
         let nombreArcs = 0;
         const ajouterSommetsEtArcs = () => {
@@ -231,7 +254,7 @@ function creerGraphe() {
                 const ajouterArc = () => {
                     rl.question('Entrez l\'arc à ajouter (format: src dest poids), ou "fin" pour terminer: ', (data) => {
                         if (data.toLowerCase() === 'fin') {
-                            finaliserGraphe();
+                            finaliserGraphe(commentaire, graphe);
                         }
                         else {
                             const [src, dest, poids] = data.split(' ').map(Number);
@@ -244,24 +267,24 @@ function creerGraphe() {
                 ajouterArc();
             });
         };
-        const finaliserGraphe = () => {
-            rl.question('Entrez le chemin pour sauvegarder le graphe: ', (chemin) => {
-                const output = (0, fs_1.createWriteStream)(chemin);
-                output.write(`c ${commentaire}\n`);
-                graphe.mettreAJourInfosGraphe();
-                output.write(`${graphe.getInfosGraphe()}\n`);
-                graphe.sauvegarderGraphe(output);
-                output.end();
-                console.log('Graphe créé et sauvegardé.');
-                afficherMenu();
-            });
-        };
         ajouterSommetsEtArcs();
     });
 }
-function calculerIsochrones() {
+function finaliserGraphe(commentaire, graphe) {
+    rl.question('Entrez le chemin pour sauvegarder le graphe: ', (chemin) => {
+        const output = (0, fs_1.createWriteStream)(chemin);
+        output.write(`c ${commentaire}\n`);
+        graphe.mettreAJourInfosGraphe();
+        output.write(`${graphe.getInfosGraphe()}\n`);
+        graphe.sauvegarderGraphe(output);
+        output.end();
+        console.log('Graphe créé et sauvegardé.');
+        afficherMenu();
+    });
+}
+function calculerIsochrones(utiliserListeAdjacence) {
     rl.question('Entrez le chemin du fichier de graphe: ', (chemin) => {
-        const graphe = new GrapheOrientePondere_1.GrapheOrientePondere(chemin);
+        const graphe = new GrapheOrientePondere_1.GrapheOrientePondere(utiliserListeAdjacence, chemin);
         rl.question('Entrez le sommet de départ: ', (data) => {
             const sommetInitial = parseInt(data);
             if (sommetInitial < 0 || sommetInitial >= graphe.nombreSommets()) {
@@ -278,7 +301,7 @@ function calculerIsochrones() {
                         console.log(`Distance de ${sommetInitial} à ${i}: ${resultat.distances[i]}`);
                     }
                     else {
-                        console.log(`Distance de ${sommetInitial} à ${i}: Infinity`);
+                        console.log(`Distance de ${sommetInitial} à ${i}: Infini`);
                     }
                 }
                 console.log("Prédécesseurs :");
@@ -295,4 +318,15 @@ function calculerIsochrones() {
         });
     });
 }
+function detecterRepresentation(fichier) {
+    const lignes = (0, fs_1.readFileSync)(fichier, 'utf8').split('\n');
+    for (let ligne of lignes) {
+        if (ligne.startsWith('p sp ')) {
+            const [, , numSommets] = ligne.split(' ');
+            const n = parseInt(numSommets);
+            return n < 100;
+        }
+    }
+    return true; // Par défaut, utilise la liste d'adjacence
+}
 afficherMenu();
diff --git a/code/src/index.ts b/code/src/index.ts
index bb0c30c050f6aa262609d4cc4a72105ba9302a61..5ea45707268c612f3b360facf44cd93eefc6556f 100644
--- a/code/src/index.ts
+++ b/code/src/index.ts
@@ -1,7 +1,7 @@
 import * as readline from 'readline';
 import { GrapheOrientePondere } from './GrapheOrientePondere';
 import { dijkstra } from './dijkstra';
-import { createWriteStream } from 'fs';
+import { createWriteStream, readFileSync } from 'fs';
 
 const rl = readline.createInterface({
     input: process.stdin,
@@ -20,10 +20,10 @@ function afficherMenu() {
                 menuModifierGraphe();
                 break;
             case '2':
-                creerGraphe();
+                choisirRepresentationPourCreation();
                 break;
             case '3':
-                calculerIsochrones();
+                choisirRepresentationPourCalcul();
                 break;
             case '4':
                 console.log("Au revoir !");
@@ -36,10 +36,33 @@ function afficherMenu() {
         }
     });
 }
- 
+
+function choisirRepresentationPourCreation() {
+    rl.question('Voulez-vous utiliser une liste d\'adjacence (1) ou une matrice d\'adjacence (2)? ', (reponse) => {
+        if (reponse === '1' || reponse === '2') {
+            creerGraphe(reponse === '1');
+        } else {
+            console.log("Option invalide. Veuillez réessayer.");
+            choisirRepresentationPourCreation();
+        }
+    });
+}
+
+function choisirRepresentationPourCalcul() {
+    rl.question('Voulez-vous utiliser une liste d\'adjacence (1) ou une matrice d\'adjacence (2)? ', (reponse) => {
+        if (reponse === '1' || reponse === '2') {
+            calculerIsochrones(reponse === '1');
+        } else {
+            console.log("Option invalide. Veuillez réessayer.");
+            choisirRepresentationPourCalcul();
+        }
+    });
+}
+
 function menuModifierGraphe() {
     rl.question('Entrez le chemin du fichier de graphe à modifier: ', (chemin) => {
-        const graphe = new GrapheOrientePondere(chemin);
+        const utiliserListeAdjacence = detecterRepresentation(chemin);
+        const graphe = new GrapheOrientePondere(utiliserListeAdjacence, chemin); // Détecte la représentation à utiliser
         console.log("Graphe chargé.");
         afficherSousMenuModification(graphe, chemin);
     });
@@ -194,9 +217,9 @@ function afficherSousMenuModification(graphe: GrapheOrientePondere, chemin: stri
     });
 }
 
-function creerGraphe() {
+function creerGraphe(utiliserListeAdjacence: boolean) {
     rl.question('Entrez un commentaire pour l\'instance de graphe (ligne commencée par "c"): ', (commentaire) => {
-        const graphe = new GrapheOrientePondere();
+        const graphe = new GrapheOrientePondere(utiliserListeAdjacence);
         let nombreSommets = 0;
         let nombreArcs = 0;
 
@@ -208,7 +231,7 @@ function creerGraphe() {
                 const ajouterArc = () => {
                     rl.question('Entrez l\'arc à ajouter (format: src dest poids), ou "fin" pour terminer: ', (data) => {
                         if (data.toLowerCase() === 'fin') {
-                            finaliserGraphe();
+                            finaliserGraphe(commentaire, graphe);
                         } else {
                             const [src, dest, poids] = data.split(' ').map(Number);
                             graphe.ajouterArc(src, dest, poids);
@@ -222,26 +245,26 @@ function creerGraphe() {
             });
         };
 
-        const finaliserGraphe = () => {
-            rl.question('Entrez le chemin pour sauvegarder le graphe: ', (chemin) => {
-                const output = createWriteStream(chemin);
-                output.write(`c ${commentaire}\n`);
-                graphe.mettreAJourInfosGraphe(); 
-                output.write(`${graphe.getInfosGraphe()}\n`);
-                graphe.sauvegarderGraphe(output);
-                output.end();
-                console.log('Graphe créé et sauvegardé.');
-                afficherMenu();
-            });
-        };
-
         ajouterSommetsEtArcs();
     });
 }
 
-function calculerIsochrones() {
+function finaliserGraphe(commentaire: string, graphe: GrapheOrientePondere) {
+    rl.question('Entrez le chemin pour sauvegarder le graphe: ', (chemin) => {
+        const output = createWriteStream(chemin);
+        output.write(`c ${commentaire}\n`);
+        graphe.mettreAJourInfosGraphe(); 
+        output.write(`${graphe.getInfosGraphe()}\n`);
+        graphe.sauvegarderGraphe(output);
+        output.end();
+        console.log('Graphe créé et sauvegardé.');
+        afficherMenu();
+    });
+}
+
+function calculerIsochrones(utiliserListeAdjacence: boolean) {
     rl.question('Entrez le chemin du fichier de graphe: ', (chemin) => {
-        const graphe = new GrapheOrientePondere(chemin);
+        const graphe = new GrapheOrientePondere(utiliserListeAdjacence, chemin);
         rl.question('Entrez le sommet de départ: ', (data) => {
             const sommetInitial = parseInt(data);
             if (sommetInitial < 0 || sommetInitial >= graphe.nombreSommets()) {
@@ -258,7 +281,7 @@ function calculerIsochrones() {
                     if (resultat.distances[i] !== Infinity) {
                         console.log(`Distance de ${sommetInitial} à ${i}: ${resultat.distances[i]}`);
                     } else {
-                        console.log(`Distance de ${sommetInitial} à ${i}: Infinity`);
+                        console.log(`Distance de ${sommetInitial} à ${i}: Infini`);
                     }
                 }
 
@@ -277,4 +300,16 @@ function calculerIsochrones() {
     });
 }
 
+function detecterRepresentation(fichier: string): boolean {
+    const lignes = readFileSync(fichier, 'utf8').split('\n');
+    for (let ligne of lignes) {
+        if (ligne.startsWith('p sp ')) {
+            const [, , numSommets] = ligne.split(' ');
+            const n = parseInt(numSommets);
+            return n < 100; 
+        }
+    }
+    return true; // Par défaut, utilise la liste d'adjacence
+}
+
 afficherMenu();
diff --git a/code/test_graphe_liste.txt b/code/test_graphe_liste.txt
new file mode 100644
index 0000000000000000000000000000000000000000..6ace6bcfbc391d73d2532b6ba294e416feab4ff8
--- /dev/null
+++ b/code/test_graphe_liste.txt
@@ -0,0 +1,4 @@
+
+p sp 4 2
+a 1 2 5
+a 2 3 10
diff --git a/code/test_graphe_matrice.txt b/code/test_graphe_matrice.txt
new file mode 100644
index 0000000000000000000000000000000000000000..6ace6bcfbc391d73d2532b6ba294e416feab4ff8
--- /dev/null
+++ b/code/test_graphe_matrice.txt
@@ -0,0 +1,4 @@
+
+p sp 4 2
+a 1 2 5
+a 2 3 10
diff --git a/code/tests/dijkstra.test.js b/code/tests/dijkstra.test.js
new file mode 100644
index 0000000000000000000000000000000000000000..e96da2958c42e014aafc75332b06dd68386eeafc
--- /dev/null
+++ b/code/tests/dijkstra.test.js
@@ -0,0 +1,33 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+const GrapheOrientePondere_1 = require("../src/GrapheOrientePondere");
+const dijkstra_1 = require("../src/dijkstra");
+// Test simple pour vérifier le fonctionnement de l'algorithme de Dijkstra
+test("Dijkstra - Graphe simple", () => {
+    const graphe = new GrapheOrientePondere_1.GrapheOrientePondere();
+    graphe.redimensionnerSommets(4);
+    graphe.ajouterArc(1, 2, 3);
+    graphe.ajouterArc(1, 3, 4);
+    graphe.ajouterArc(2, 1, 2);
+    graphe.ajouterArc(2, 3, 1);
+    const resultat = (0, dijkstra_1.dijkstra)(graphe, 1, Infinity);
+    expect(resultat.obtenirDistance(1)).toBe(0);
+    expect(resultat.obtenirDistance(2)).toBe(3);
+    expect(resultat.obtenirDistance(3)).toBe(4);
+    expect(resultat.obtenirPredecesseur(2)).toBe(1);
+    expect(resultat.obtenirPredecesseur(3)).toBe(1);
+});
+test("Dijkstra - Limite de parcours", () => {
+    const graphe = new GrapheOrientePondere_1.GrapheOrientePondere();
+    graphe.redimensionnerSommets(4);
+    graphe.ajouterArc(1, 2, 3);
+    graphe.ajouterArc(1, 3, 4);
+    graphe.ajouterArc(2, 1, 2);
+    graphe.ajouterArc(2, 3, 1);
+    const resultat = (0, dijkstra_1.dijkstra)(graphe, 1, 3);
+    expect(resultat.obtenirDistance(1)).toBe(0);
+    expect(resultat.obtenirDistance(2)).toBe(3);
+    expect(resultat.obtenirDistance(3)).toBe(Infinity);
+    expect(resultat.obtenirPredecesseur(2)).toBe(1);
+    expect(resultat.obtenirPredecesseur(3)).toBe(null);
+});
diff --git a/code/tests/grapheOrientePondere.test.js b/code/tests/grapheOrientePondere.test.js
new file mode 100644
index 0000000000000000000000000000000000000000..02380d284c2e8aaf94cbd4c05c1290290c203639
--- /dev/null
+++ b/code/tests/grapheOrientePondere.test.js
@@ -0,0 +1,172 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+const GrapheOrientePondere_1 = require("../src/GrapheOrientePondere");
+const fs_1 = require("fs");
+const testFilePathListe = "test_graphe_liste.txt";
+const testFilePathMatrice = "test_graphe_matrice.txt";
+// Test pour vérifier l'ajout et la suppression de sommets
+test("Gestion des sommets - Ajout et suppression (Liste d'adjacence)", () => {
+    const graphe = new GrapheOrientePondere_1.GrapheOrientePondere(true);
+    graphe.redimensionnerSommets(3);
+    expect(graphe.nombreSommets()).toBe(3);
+    graphe.ajouterSommet();
+    expect(graphe.nombreSommets()).toBe(4);
+    graphe.supprimerSommet(3);
+    expect(graphe.nombreSommets()).toBe(3);
+    expect(graphe.sommetExiste(3)).toBe(false);
+});
+// Test pour vérifier l'ajout, la suppression et la récupération des arcs
+test("Gestion des arcs - Ajout, suppression et récupération (Liste d'adjacence)", () => {
+    const graphe = new GrapheOrientePondere_1.GrapheOrientePondere(true);
+    graphe.redimensionnerSommets(3);
+    graphe.ajouterArc(1, 2, 5);
+    expect(graphe.testerArc(1, 2)).toBe(true);
+    expect(graphe.recupererPoids(1, 2)).toBe(5);
+    graphe.retirerArc(1, 2);
+    expect(graphe.testerArc(1, 2)).toBe(false);
+});
+test("Gestion des arcs - Ajout, suppression et récupération (Matrice d'adjacence)", () => {
+    const graphe = new GrapheOrientePondere_1.GrapheOrientePondere(false);
+    graphe.redimensionnerSommets(3);
+    graphe.ajouterArc(1, 2, 5);
+    expect(graphe.testerArc(1, 2)).toBe(true);
+    expect(graphe.recupererPoids(1, 2)).toBe(5);
+    graphe.retirerArc(1, 2);
+    expect(graphe.testerArc(1, 2)).toBe(false);
+});
+// Test pour vérifier la récupération des successeurs
+test("Récupération des successeurs (Liste d'adjacence)", () => {
+    const graphe = new GrapheOrientePondere_1.GrapheOrientePondere(true);
+    graphe.redimensionnerSommets(3);
+    graphe.ajouterArc(1, 2, 5);
+    graphe.ajouterArc(1, 3, 10);
+    const successeurs = graphe.recupererSuccesseurs(1);
+    expect(successeurs).toEqual([2, 3]);
+});
+// Test pour vérifier la récupération des prédécesseurs
+test("Récupération des prédécesseurs (Liste d'adjacence)", () => {
+    const graphe = new GrapheOrientePondere_1.GrapheOrientePondere(true);
+    graphe.redimensionnerSommets(3);
+    graphe.ajouterArc(1, 2, 5);
+    graphe.ajouterArc(3, 2, 10);
+    const predecesseurs = graphe.recupererPredecesseurs(2);
+    expect(predecesseurs).toEqual([1, 3]);
+});
+// Test pour vérifier la récupération des voisins
+test("Récupération des voisins (Liste d'adjacence)", () => {
+    const graphe = new GrapheOrientePondere_1.GrapheOrientePondere(true);
+    graphe.redimensionnerSommets(3);
+    graphe.ajouterArc(1, 2, 5);
+    graphe.ajouterArc(2, 3, 10);
+    const voisins = graphe.recupererVoisins(2).sort((a, b) => a - b);
+    expect(voisins).toEqual([1, 3]);
+});
+// Test pour vérifier l'ajout de sommets multiples
+test("Ajout de sommets multiples (Liste d'adjacence)", () => {
+    const graphe = new GrapheOrientePondere_1.GrapheOrientePondere(true);
+    graphe.redimensionnerSommets(5);
+    expect(graphe.nombreSommets()).toBe(5);
+    graphe.ajouterSommet();
+    graphe.ajouterSommet();
+    expect(graphe.nombreSommets()).toBe(7);
+});
+test("Ajout de sommets multiples (Matrice d'adjacence)", () => {
+    const graphe = new GrapheOrientePondere_1.GrapheOrientePondere(false);
+    graphe.redimensionnerSommets(5);
+    expect(graphe.nombreSommets()).toBe(5);
+    graphe.ajouterSommet();
+    graphe.ajouterSommet();
+    expect(graphe.nombreSommets()).toBe(7);
+});
+// Test pour vérifier la suppression d'un sommet qui n'existe pas
+test("Suppression d'un sommet qui n'existe pas (Liste d'adjacence)", () => {
+    const graphe = new GrapheOrientePondere_1.GrapheOrientePondere(true);
+    graphe.redimensionnerSommets(3);
+    expect(graphe.nombreSommets()).toBe(3);
+    graphe.supprimerSommet(5);
+    expect(graphe.nombreSommets()).toBe(3);
+});
+test("Suppression d'un sommet qui n'existe pas (Matrice d'adjacence)", () => {
+    const graphe = new GrapheOrientePondere_1.GrapheOrientePondere(false);
+    graphe.redimensionnerSommets(3);
+    expect(graphe.nombreSommets()).toBe(3);
+    graphe.supprimerSommet(5);
+    expect(graphe.nombreSommets()).toBe(3);
+});
+// Test pour vérifier la récupération des arcs
+test("Récupération des arcs (Liste d'adjacence)", () => {
+    const graphe = new GrapheOrientePondere_1.GrapheOrientePondere(true);
+    graphe.redimensionnerSommets(4);
+    graphe.ajouterArc(1, 2, 5);
+    graphe.ajouterArc(2, 3, 10);
+    graphe.ajouterArc(3, 4, 15);
+    expect(graphe.recupererPoids(1, 2)).toBe(5);
+    expect(graphe.recupererPoids(2, 3)).toBe(10);
+    expect(graphe.recupererPoids(3, 4)).toBe(15);
+});
+test("Récupération des arcs (Matrice d'adjacence)", () => {
+    const graphe = new GrapheOrientePondere_1.GrapheOrientePondere(false);
+    graphe.redimensionnerSommets(4);
+    graphe.ajouterArc(1, 2, 5);
+    graphe.ajouterArc(2, 3, 10);
+    graphe.ajouterArc(3, 4, 15);
+    expect(graphe.recupererPoids(1, 2)).toBe(5);
+    expect(graphe.recupererPoids(2, 3)).toBe(10);
+    expect(graphe.recupererPoids(3, 4)).toBe(15);
+});
+// Test pour vérifier la sauvegarde et la lecture du graphe
+test("Sauvegarde et lecture du graphe (Liste d'adjacence)", () => {
+    const graphe = new GrapheOrientePondere_1.GrapheOrientePondere(true);
+    graphe.redimensionnerSommets(4);
+    graphe.ajouterArc(1, 2, 5);
+    graphe.ajouterArc(2, 3, 10);
+    const path = testFilePathListe;
+    graphe.sauvegarderGraphe(path);
+    const nouveauGraphe = new GrapheOrientePondere_1.GrapheOrientePondere(true, path);
+    expect(nouveauGraphe.nombreSommets()).toBe(4);
+    expect(nouveauGraphe.nombreArcs()).toBe(2);
+    expect(nouveauGraphe.recupererPoids(1, 2)).toBe(5);
+    expect(nouveauGraphe.recupererPoids(2, 3)).toBe(10);
+});
+test("Sauvegarde et lecture du graphe (Matrice d'adjacence)", () => {
+    const graphe = new GrapheOrientePondere_1.GrapheOrientePondere(false);
+    graphe.redimensionnerSommets(4);
+    graphe.ajouterArc(1, 2, 5);
+    graphe.ajouterArc(2, 3, 10);
+    const path = testFilePathMatrice;
+    graphe.sauvegarderGraphe(path);
+    const nouveauGraphe = new GrapheOrientePondere_1.GrapheOrientePondere(false, path);
+    expect(nouveauGraphe.nombreSommets()).toBe(4);
+    expect(nouveauGraphe.nombreArcs()).toBe(2);
+    expect(nouveauGraphe.recupererPoids(1, 2)).toBe(5);
+    expect(nouveauGraphe.recupererPoids(2, 3)).toBe(10);
+});
+// Test pour vérifier la mise à jour des informations du graphe
+test("Mise à jour des informations du graphe (Liste d'adjacence)", () => {
+    const graphe = new GrapheOrientePondere_1.GrapheOrientePondere(true);
+    graphe.redimensionnerSommets(3);
+    graphe.ajouterArc(1, 2, 5);
+    expect(graphe.getInfosGraphe()).toBe("p sp 3 1");
+    graphe.ajouterArc(2, 3, 10);
+    graphe.redimensionnerSommets(4);
+    expect(graphe.getInfosGraphe()).toBe("p sp 4 2");
+});
+test("Mise à jour des informations du graphe (Matrice d'adjacence)", () => {
+    const graphe = new GrapheOrientePondere_1.GrapheOrientePondere(false);
+    graphe.redimensionnerSommets(3);
+    graphe.ajouterArc(1, 2, 5);
+    expect(graphe.getInfosGraphe()).toBe("p sp 3 1");
+    graphe.ajouterArc(2, 3, 10);
+    graphe.redimensionnerSommets(4);
+    expect(graphe.getInfosGraphe()).toBe("p sp 4 2");
+});
+beforeAll(() => {
+    // Avant tous les tests, créez le fichier de test
+    (0, fs_1.writeFileSync)(testFilePathListe, 'c Test graph\np sp 4 2\na 1 2 5\na 2 3 10\n');
+    (0, fs_1.writeFileSync)(testFilePathMatrice, 'c Test graph\np sp 4 2\na 1 2 5\na 2 3 10\n');
+});
+afterAll(() => {
+    // Après tous les tests, pour supprimer le fichier de test
+    (0, fs_1.unlinkSync)(testFilePathListe);
+    (0, fs_1.unlinkSync)(testFilePathMatrice);
+});
diff --git a/code/tests/grapheOrientePondere.test.ts b/code/tests/grapheOrientePondere.test.ts
index 867556bf448f2bf8eb3756b8ba2cf20988da7f14..057ef8896e58b631eef79f5fbb8dcb152f6100da 100644
--- a/code/tests/grapheOrientePondere.test.ts
+++ b/code/tests/grapheOrientePondere.test.ts
@@ -1,11 +1,12 @@
 import { GrapheOrientePondere } from "../src/GrapheOrientePondere";
 import { writeFileSync, unlinkSync } from "fs";
 
-const testFilePath = "test_graphe.txt";
+const testFilePathListe = "test_graphe_liste.txt";
+const testFilePathMatrice = "test_graphe_matrice.txt";
 
 // Test pour vérifier l'ajout et la suppression de sommets
-test("Gestion des sommets - Ajout et suppression", () => {
-  const graphe = new GrapheOrientePondere();
+test("Gestion des sommets - Ajout et suppression (Liste d'adjacence)", () => {
+  const graphe = new GrapheOrientePondere(true);
   graphe.redimensionnerSommets(3);
 
   expect(graphe.nombreSommets()).toBe(3);
@@ -18,9 +19,22 @@ test("Gestion des sommets - Ajout et suppression", () => {
   expect(graphe.sommetExiste(3)).toBe(false);
 });
 
+
 // Test pour vérifier l'ajout, la suppression et la récupération des arcs
-test("Gestion des arcs - Ajout, suppression et récupération", () => {
-  const graphe = new GrapheOrientePondere();
+test("Gestion des arcs - Ajout, suppression et récupération (Liste d'adjacence)", () => {
+  const graphe = new GrapheOrientePondere(true);
+  graphe.redimensionnerSommets(3);
+  graphe.ajouterArc(1, 2, 5);
+
+  expect(graphe.testerArc(1, 2)).toBe(true);
+  expect(graphe.recupererPoids(1, 2)).toBe(5);
+
+  graphe.retirerArc(1, 2);
+  expect(graphe.testerArc(1, 2)).toBe(false);
+});
+
+test("Gestion des arcs - Ajout, suppression et récupération (Matrice d'adjacence)", () => {
+  const graphe = new GrapheOrientePondere(false);
   graphe.redimensionnerSommets(3);
   graphe.ajouterArc(1, 2, 5);
 
@@ -32,8 +46,8 @@ test("Gestion des arcs - Ajout, suppression et récupération", () => {
 });
 
 // Test pour vérifier la récupération des successeurs
-test("Récupération des successeurs", () => {
-  const graphe = new GrapheOrientePondere();
+test("Récupération des successeurs (Liste d'adjacence)", () => {
+  const graphe = new GrapheOrientePondere(true);
   graphe.redimensionnerSommets(3);
   graphe.ajouterArc(1, 2, 5);
   graphe.ajouterArc(1, 3, 10);
@@ -43,8 +57,8 @@ test("Récupération des successeurs", () => {
 });
 
 // Test pour vérifier la récupération des prédécesseurs
-test("Récupération des prédécesseurs", () => {
-  const graphe = new GrapheOrientePondere();
+test("Récupération des prédécesseurs (Liste d'adjacence)", () => {
+  const graphe = new GrapheOrientePondere(true);
   graphe.redimensionnerSommets(3);
   graphe.ajouterArc(1, 2, 5);
   graphe.ajouterArc(3, 2, 10);
@@ -54,8 +68,8 @@ test("Récupération des prédécesseurs", () => {
 });
 
 // Test pour vérifier la récupération des voisins
-test("Récupération des voisins", () => {
-  const graphe = new GrapheOrientePondere();
+test("Récupération des voisins (Liste d'adjacence)", () => {
+  const graphe = new GrapheOrientePondere(true);
   graphe.redimensionnerSommets(3);
   graphe.ajouterArc(1, 2, 5);
   graphe.ajouterArc(2, 3, 10);
@@ -64,9 +78,22 @@ test("Récupération des voisins", () => {
   expect(voisins).toEqual([1, 3]);
 });
 
+
+
 // Test pour vérifier l'ajout de sommets multiples
-test("Ajout de sommets multiples", () => {
-  const graphe = new GrapheOrientePondere();
+test("Ajout de sommets multiples (Liste d'adjacence)", () => {
+  const graphe = new GrapheOrientePondere(true);
+  graphe.redimensionnerSommets(5);
+
+  expect(graphe.nombreSommets()).toBe(5);
+
+  graphe.ajouterSommet();
+  graphe.ajouterSommet();
+  expect(graphe.nombreSommets()).toBe(7);
+});
+
+test("Ajout de sommets multiples (Matrice d'adjacence)", () => {
+  const graphe = new GrapheOrientePondere(false);
   graphe.redimensionnerSommets(5);
 
   expect(graphe.nombreSommets()).toBe(5);
@@ -77,8 +104,18 @@ test("Ajout de sommets multiples", () => {
 });
 
 // Test pour vérifier la suppression d'un sommet qui n'existe pas
-test("Suppression d'un sommet qui n'existe pas", () => {
-  const graphe = new GrapheOrientePondere();
+test("Suppression d'un sommet qui n'existe pas (Liste d'adjacence)", () => {
+  const graphe = new GrapheOrientePondere(true);
+  graphe.redimensionnerSommets(3);
+
+  expect(graphe.nombreSommets()).toBe(3);
+
+  graphe.supprimerSommet(5);
+  expect(graphe.nombreSommets()).toBe(3);
+});
+
+test("Suppression d'un sommet qui n'existe pas (Matrice d'adjacence)", () => {
+  const graphe = new GrapheOrientePondere(false);
   graphe.redimensionnerSommets(3);
 
   expect(graphe.nombreSommets()).toBe(3);
@@ -88,8 +125,20 @@ test("Suppression d'un sommet qui n'existe pas", () => {
 });
 
 // Test pour vérifier la récupération des arcs
-test("Récupération des arcs", () => {
-  const graphe = new GrapheOrientePondere();
+test("Récupération des arcs (Liste d'adjacence)", () => {
+  const graphe = new GrapheOrientePondere(true);
+  graphe.redimensionnerSommets(4);
+  graphe.ajouterArc(1, 2, 5);
+  graphe.ajouterArc(2, 3, 10);
+  graphe.ajouterArc(3, 4, 15);
+
+  expect(graphe.recupererPoids(1, 2)).toBe(5);
+  expect(graphe.recupererPoids(2, 3)).toBe(10);
+  expect(graphe.recupererPoids(3, 4)).toBe(15);
+});
+
+test("Récupération des arcs (Matrice d'adjacence)", () => {
+  const graphe = new GrapheOrientePondere(false);
   graphe.redimensionnerSommets(4);
   graphe.ajouterArc(1, 2, 5);
   graphe.ajouterArc(2, 3, 10);
@@ -101,16 +150,32 @@ test("Récupération des arcs", () => {
 });
 
 // Test pour vérifier la sauvegarde et la lecture du graphe
-test("Sauvegarde et lecture du graphe", () => {
-  const graphe = new GrapheOrientePondere();
+test("Sauvegarde et lecture du graphe (Liste d'adjacence)", () => {
+  const graphe = new GrapheOrientePondere(true);
   graphe.redimensionnerSommets(4);
   graphe.ajouterArc(1, 2, 5);
   graphe.ajouterArc(2, 3, 10);
 
-  const path = testFilePath;
+  const path = testFilePathListe;
   graphe.sauvegarderGraphe(path);
 
-  const nouveauGraphe = new GrapheOrientePondere(path);
+  const nouveauGraphe = new GrapheOrientePondere(true, path);
+  expect(nouveauGraphe.nombreSommets()).toBe(4);
+  expect(nouveauGraphe.nombreArcs()).toBe(2);
+  expect(nouveauGraphe.recupererPoids(1, 2)).toBe(5);
+  expect(nouveauGraphe.recupererPoids(2, 3)).toBe(10);
+});
+
+test("Sauvegarde et lecture du graphe (Matrice d'adjacence)", () => {
+  const graphe = new GrapheOrientePondere(false);
+  graphe.redimensionnerSommets(4);
+  graphe.ajouterArc(1, 2, 5);
+  graphe.ajouterArc(2, 3, 10);
+
+  const path = testFilePathMatrice;
+  graphe.sauvegarderGraphe(path);
+
+  const nouveauGraphe = new GrapheOrientePondere(false, path);
   expect(nouveauGraphe.nombreSommets()).toBe(4);
   expect(nouveauGraphe.nombreArcs()).toBe(2);
   expect(nouveauGraphe.recupererPoids(1, 2)).toBe(5);
@@ -118,8 +183,21 @@ test("Sauvegarde et lecture du graphe", () => {
 });
 
 // Test pour vérifier la mise à jour des informations du graphe
-test("Mise à jour des informations du graphe", () => {
-  const graphe = new GrapheOrientePondere();
+test("Mise à jour des informations du graphe (Liste d'adjacence)", () => {
+  const graphe = new GrapheOrientePondere(true);
+  graphe.redimensionnerSommets(3);
+  graphe.ajouterArc(1, 2, 5);
+
+  expect(graphe.getInfosGraphe()).toBe("p sp 3 1");
+
+  graphe.ajouterArc(2, 3, 10);
+  graphe.redimensionnerSommets(4);
+
+  expect(graphe.getInfosGraphe()).toBe("p sp 4 2");
+});
+
+test("Mise à jour des informations du graphe (Matrice d'adjacence)", () => {
+  const graphe = new GrapheOrientePondere(false);
   graphe.redimensionnerSommets(3);
   graphe.ajouterArc(1, 2, 5);
 
@@ -133,10 +211,12 @@ test("Mise à jour des informations du graphe", () => {
 
 beforeAll(() => {
   // Avant tous les tests, créez le fichier de test
-  writeFileSync(testFilePath, 'c Test graph\np sp 4 2\na 1 2 5\na 2 3 10\n');
+  writeFileSync(testFilePathListe, 'c Test graph\np sp 4 2\na 1 2 5\na 2 3 10\n');
+  writeFileSync(testFilePathMatrice, 'c Test graph\np sp 4 2\na 1 2 5\na 2 3 10\n');
 });
 
 afterAll(() => {
   // Après tous les tests, pour supprimer le fichier de test
-  unlinkSync(testFilePath);
+  unlinkSync(testFilePathListe);
+  unlinkSync(testFilePathMatrice);
 });