Most voted "graph" questions
Graph theory is a branch of mathematics that studies the relationships between the objects of a given set. For this are employed structures called graphs, G(V,A), where V is a nonempty set of objects called vertices and A is a set of unordered pairs of V, called edges.
Learn more…82 questions
Sort by count of
-
1
votes0
answers146
viewsTraveling Salesman - Exhaustive Algorithm
I need to create an algorithm that: 1. Discover all possible paths that visit all vertices of a graph without going through the same vertices twice. 2. Store all results. 3. Return the path with the…
-
1
votes1
answer471
viewsAlgorithm Graphs to solve Sudoku
I’m having a doubt, my code when it runs in one of the examples of Sudoku, it prints at the end the expected result, the other example of sudoku it does not print correctly the expected result. I’d…
-
1
votes0
answers56
viewsGraph represented as list linked to list
I am trying to implement a graph with list structure linked to list by pulling the data from a txt file (input.txt). A 100 2 B 3 D 4 B 150 2 C 3 E 2 C 150 1 F 2 D 150 1 E 4 E 100 1 F 1 F 200 0 The…
-
1
votes0
answers50
viewsProblem in classifying graph edges
I’m making an algorithm to classify the Edges of a graph, between Type T, B ,C and F. It’s giving me a wrong output, it finishes vertex 3 at the same time it starts 4, so it doesn’t end up…
-
1
votes0
answers92
viewsPass input numbers to Python array
I’m doing an exercise on bipartite graphs, in which the input is given in the following form: 6 2 4 5 1 3 2 3 5 1 0 2 2 1 1 1 Being 6 (the number of the first line) the number of lines to be read,…
-
1
votes1
answer220
viewsAdd tuple in Python set
I am creating a graph with the following rules: The graph is a dictionary. The vertices are the keys of this dictionary and the values are the edges. Since I can have more than one edge for a…
-
1
votes0
answers31
viewsDijkstra Algorithm with Priority Queue - Why and Poll are not working, is my logic wrong?
I’m trying to apply the algorithm of Dijkstra using Priority Precise to leave it with logarithmic complexity T(N) = E*log(n) The first node manages to find its neighbors and relax its values but the…
-
1
votes0
answers40
viewsC++: Add an integer variable in an ordered way in a list
I need to add integers in an orderly way, within a list implementation that I developed. //Implementação dos nós para serem usados na lista NodeList::NodeList(int dataa){ this->next = NULL;…
-
0
votes1
answer1532
viewsC# framework implementing graph theory
Does anyone know any C# framework and implement Graph Theory?
-
0
votes1
answer842
viewsIs there a graphical interface Apis for Graphs on android?
I searched a lot on the Internet but found nothing corresponding in Portuguese and in English I found some things but no resolution about it. Does anyone have any knowledge about the existence of a…
-
0
votes1
answer140
viewsCircular Oriented Graphs with Mongodb
Does anyone know if it is possible to create circular oriented graphs with Mongodb or need a specific graph oriented database like neo4j. Node A (The alloy with B) Node B (B connects with C) Node C…
-
0
votes0
answers77
viewsFlow at minimum cost
How do I find the minimum cost flow in a graph whose arcs have a lower and higher limit to the flow and a cost per unit of flow? Note: Do not use linear programming. Initially there is no viable…
-
0
votes1
answer121
viewsCreate Graphs with Tsimplegraph
I need to create graphs in the interface of my program, the only solution I found was the Tsimplegraph. I tried running the program that comes in ZIP file, but gives error that is missing component…
-
0
votes1
answer574
viewsHow to check if the value of a key exists on a map in c++
I am doing a graph TAD and I use a map structure to map the ID of a vertex to its index in the adjacency matrix and to do this I need to first check if given the vertex id it is already added to the…
-
0
votes1
answer133
viewsWhich software to use to generate a picture of a giant graph?
I have a program in c++, done with graph representation with adjacency list, however, there are more than 2 million nodes in it. Is there any software that has a text format, that I can generate…
-
0
votes1
answer71
views -
0
votes1
answer182
viewsChange color of a node in a Neo4j graph
I created an example graph in Neo4j with a father and two children. I would like to know how to change the color of all nodes that have the level 1. When I click on the node appears at the bottom to…
-
0
votes0
answers177
viewsC - Stack Smashing Detected - How to correctly initialize a graph by adjacency list and insert edges?
I am receiving, sporadically and without having made any changes to the code or input, an error called Stack Smashing Detected. The only things I’m doing is initializing a graph and inserting an…
-
0
votes1
answer182
viewsPlot function of igraph - (python)
I tried to use the igraph library for python in order to plot a graph, I used the very example of the documentation, but it didn’t work. Code used: import igraph from igraph import plot g =…
-
0
votes0
answers85
viewsMemory junk when pointing a pointer
In an attempt to implement an adjacent matrix graph, I created the function to create a new "matrix" in which the contents of the graph would be copied to it by adding the new positions. However,…
-
0
votes1
answer523
viewsSearching in depth using a stack
I’m trying to do an in-depth search using a stack, but it’s making a mistake on a if and I don’t know why. package Grafos; import java.io.*; import java.util.*; public class Grafo {…
-
0
votes1
answer51
viewsProblem Related to graphs
I’m making this issue in the URI Online Judge. I’m trying with DFS, but until now I got nothing. I put a variable to mark up to the level she goes and when she gets to this level she comes back, but…
-
0
votes1
answer407
viewsRead a text file and separate content into variables
I have a question about how to divide information from a text file into variables in C. Example, I have a txt file with the following data: 3 2 A D E AD DE I would like to read this file, and…
-
0
votes0
answers222
viewsFord-Fulkerson Python algorithm
I’m doing a college paper where I need to implement the Ford-Fulkerson algorithm in Python. However, I am having difficulty finding an augmenting path in the residual graph (path function). I don’t…
-
0
votes1
answer128
viewsTrying to build a graph
Well, folks, I suppose my problem is pretty simple, but I’m having a hard time, so if you could help me I’d appreciate it! What I want is the following: create a vector that can allocate several…
-
0
votes0
answers43
viewsI’m going into an infinite loop but I can’t find the reason why
I basically have a complete graph represented as an adjacency list, i have to find between all vertices a path between a specific vertex up to some vertex with interest = 1 where what I want to…
-
0
votes0
answers7
viewsIs there a Force-Directed Graph term in English?
What do I call this kind of graph representation in English? Or should I use the term in English anyway? with the library D3 the code would be that to create the "Force" var simulation =…
-
0
votes1
answer34
viewsGroup vertices as a function of Weights
Based on a link df I want to select all possible paths consisting only of vertices whose links check a certain condition in this case value >=3 library(igraph) library(dplyr) df <- data.frame(…
-
-1
votes1
answer187
viewsHow to discover all possible paths to visit all vertices of a graph?
I need to store all possible routes to visit the vertices of a graph without going through the same vertex twice (TSP), I thought of generating the routes randomly and storing all that are not…
-
-1
votes1
answer188
viewsDIJKSTRA IN JAVA
Hello. I am implementing a graph and as a smaller path algorithm, I am using DIJKSTRA. The graph indicates the relation of genders and their respective subgenera. The graph is directional,…
-
-1
votes2
answers31
viewsEdges with incorrect values
When running the code below, I do not get the expected graphic representation. Although A is connected to C with a value of 90.16 on Plot the link A - C is 80. Someone can help? library(igraph) df1…
-
-2
votes1
answer56
viewsInsert edge into graph
I’m trying to insert an edge into a graph. The problem is to represent a metro line, considering the existing information in csv files. I created the classes Vertex, Edge, Station(Vertex),…