All Questions
441 questions
1
vote
2
answers
98
views
How to print a graph correctly in C
So i have this file format like this
aAa 5 bBb
bBb 3 cCc
cCc 7 dDd
dDd 2 eEe
eEe 8 fFf
fFf 4 gGg
gGg 6 hHh
hHh 1 iIi
iIi 9 jJj
...
2
votes
0
answers
156
views
What is the name of this graph data structure from quake map compiler? And what are some alternatives for Rust?
I came across this data structure in the source code for the quake map compiler (specifically for portal graph generation), you can look at the specific implementation and its usage over there. Here's ...
0
votes
1
answer
484
views
Creating dijkstras algorithm and having issues in C language
In my program, I'm tasked to take the first input, node names, then depending on the count of the node names we enter x amount of lines of graphs for the matrix used to display the possible paths for ...
1
vote
0
answers
88
views
An uninitialized integer is basically being initialized to 0 (by compiler?) [duplicate]
In my Discrete Structures for Computer Science assignment, one function is :
int find_impossible_pairs(Graph *g)
{
int **closure = warshall(g); // Do not modify
int impossible_pairs;
...
0
votes
1
answer
78
views
Why is the traversal not getting printed?
I wrote a code for depth first search in C using linked list. I have used stack implementation using linked list in it.
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
...
0
votes
1
answer
41
views
Accessing a graph created in C from another application
I am creating a very large graph in the C language, the construction of which takes quite a significant amount of time (about 10 minutes). To illustrate, here is the structure of the graph:
#define N ...
5
votes
1
answer
302
views
Creating a Graph using Adjacency List
I am following Skiena's Algorithm Design Manual v3.
I have seen a few questions stating that there are certain typos in the book, and I am not sure whether this is one or just because I cannot ...
0
votes
0
answers
48
views
Finding minimum spanning tree with Kruskal's, but there are overlap vertex
I tried to find minimum spanning tree with given graph (as adjacency list), priority queue and union-find method (with kruskal).
But there are two differences with my desired output :
First, The ...
1
vote
1
answer
113
views
Multiple-Weighted Graph Elimination
I have a multiple weighted graph. Each between nodes are showing the paths from a city to another city and each edge have a time, distance and cost. The user should enter a start and an end point and ...
0
votes
1
answer
62
views
Find BFS best path array
Description:
I have a problem very similar to https://leetcode.com/problems/jump-game-ii/description/.
Apart from discovering the minimum steps to reach the end, I need to retrieve the winning path ...
1
vote
1
answer
89
views
big graph storing in adjacency list
My project is to create a graph with 1-2 milions nodes using adjacency list. Input data is from text file. I need to count the connected components and max/min degree of vetices of each components. My ...
1
vote
0
answers
30
views
Bidiretional Graph in C with weighted arcs. Error while checking the input
I've made this program to create a weighted graph for university, but when I asks inputs in main, the output is not fixed; EX:. It doesn't insert a node, sometimes it doesn't find the error in input, ...
0
votes
1
answer
211
views
How to optimize memory footprint of a graph with large amount of vertex?
I was tasked my my prof to solve a graph question. However, he hinted that one of his hidden test cases that I failed have over 80k, my code would fail as it exceeded the amount of memory that was ...
0
votes
0
answers
43
views
Physically remove vertex in a Graph C
I have a problem in my C program when i try to remove a vertex from my graph in form of adiacency lists. Here is my code:
"Phisically" remove is in simple terms the realloc of the array of ...
1
vote
2
answers
482
views
C Implementation of Depth First Search Algorithm Without Pointers (Graph as Adjacency Matrix)
The Question can be seen in the image:
Question
The following is the sample run info for the code:
Test info for the Question
Please refer to the links above for better understanding of the question.
...