-
Notifications
You must be signed in to change notification settings - Fork 1
/
graph_set_edge.c
22 lines (20 loc) · 1.14 KB
/
graph_set_edge.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* graph_set_edge.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mihykim <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/06/13 11:19:02 by mihykim #+# #+# */
/* Updated: 2020/06/13 11:25:36 by mihykim ### ########.fr */
/* */
/* ************************************************************************** */
#include "graph.h"
bool graph_set_edge(t_graph *graph, unsigned int v1, unsigned v2, bool state)
{
if (graph == NULL || graph->size <= v1 || graph->size <= v2 || v1 == v2)
return (false);
graph->matrix[v1][v2] = state;
graph->matrix[v2][v1] = state;
return (true);
}