Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Ants_colony_algorithm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
agnon.kurteshi
Ants_colony_algorithm
Commits
9e055f7e
Commit
9e055f7e
authored
2 years ago
by
agnon.kurteshi
Browse files
Options
Downloads
Patches
Plain Diff
push selon autorisation
parent
ad5f4791
Branches
main
No related tags found
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
fourmi/fourmi.c
+1
-0
1 addition, 0 deletions
fourmi/fourmi.c
fourmi/fourmi.h
+1
-0
1 addition, 0 deletions
fourmi/fourmi.h
graphe/graphe.c
+2
-1
2 additions, 1 deletion
graphe/graphe.c
le_plus_court_chemin.txt
+1
-1
1 addition, 1 deletion
le_plus_court_chemin.txt
tp_fourmi
+0
-0
0 additions, 0 deletions
tp_fourmi
with
5 additions
and
2 deletions
fourmi/fourmi.c
+
1
−
0
View file @
9e055f7e
...
...
@@ -7,6 +7,7 @@ frmi create_fourmi(int nb_sommet)
fr
->
path
=
malloc
(
sizeof
(
stack
));
stack_init
(
fr
->
path
,
nb_sommet
);
fr
->
distance
=
0
;
fr
->
ttl
=
nb_sommet
;
return
fr
;
}
...
...
This diff is collapsed.
Click to expand it.
fourmi/fourmi.h
+
1
−
0
View file @
9e055f7e
...
...
@@ -14,6 +14,7 @@ typedef struct _fourmi
stack
*
path
;
int
distance
;
//stocke la distane parcourue par la fourmi
int
depose_pheromone
;
//permet d'activer le dépôt de phéromones
int
ttl
;
}
f
;
typedef
f
*
frmi
;
...
...
This diff is collapsed.
Click to expand it.
graphe/graphe.c
+
2
−
1
View file @
9e055f7e
...
...
@@ -236,7 +236,8 @@ void create_graph_vis(graph g)
void
shortest_path
(
graph
g
,
frmi
f
,
int
noeud
)
{
if
(
noeud
==
g
->
nourriture
)
f
->
ttl
--
;
if
(
noeud
==
g
->
nourriture
||
f
->
ttl
==
0
)
{
stack_push
(
f
->
path
,
noeud
);
return
;
...
...
This diff is collapsed.
Click to expand it.
le_plus_court_chemin.txt
+
1
−
1
View file @
9e055f7e
the shortest path is
[0][1][3][7] with a cost of 8
the shortest path is
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tp_fourmi
+
0
−
0
View file @
9e055f7e
No preview for this file type
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment