графы

How to determine if there are negative weight cycles in the graph? [closed]

Closed. This question is off-topic. Answers to it are not accepted at the moment. ... Improve the question The graph is given by the adjacency matrix

A program for creating graphs

Please tell me a program (preferably for Ubuntu) in which you can create a similar graph.

How to organize the processing of a specific type of database?

There are two databases that represent 2 tables in the limit: the object table and the subobject table. The table of objects ... most simple implementation of the program (including that the library has normal documentation, there are enough examples).

Search in depth, how to output the contents of the stack? Python

It is necessary to write an algorithm for traversing the graph by searching in depth, output the current vertex, DFS number, ... tex)+1) dfs(1) I can't figure out why vertices aren't removed from the stack if they don't already have adjacent vertices.

How to set a graph in C++ (Mobius Prism)

Hello, how do I set such a graph in C++? Then n is a natural number everywhere. Let's call a graph with sets of vertice ... {(i, i + 2) | i = 0, 2n − 1} (addition modulo 2n) by the prism P (n). I use the adjacency matrix for the representation.

How to implement a weighted graph?

The graph is set by an adjacency list, read from a file. As a result, the graph = List<Node> I don't know how to progra ... t.Parse(neighbours[i]) == deletedEdge) { neighbours.RemoveAt(i); } } } }

How do I find out if there is a loop in a graph?

Don't know how to solve it ? Can you tell me how to solve this problem ? Given the adjacency matrix of an undirected graph, ... дные данные #1 3 0 1 1 1 0 1 1 1 0 Выходные данные #1 NO Входные данные #2 3 0 1 0 1 1 1 0 1 0 Выходные данные #2 YES

Finding all cycles in a graph

There is a graph represented by a list in the file, where n is the number of vertices. You need to find all the cycles in the ... canf("%d %d", &a, &b) != -1){ G[a].push_back(b); G[b].push_back(a); } // обработка графа }

Implementing a binary tree (C#) without using built-in classes and collections

The method of adding a new node does not work. class BinaryTree { class BinaryNode //узел дерева { ... for the right and left subtree). current.right = new BinaryNode(value); current = current.right; What could be wrong here?

Search for C++connectivity components?

Sample code in c++/java? Meaning, searching for connectivity components using depth/width traversal. I'm going to search the adjacency matrix.

Dinitz algorithm for finding the maximum flow

Hello, on emax I found an implementation of maximum flow in c++ using adjacency matrices:http://e-maxx.ru/algo/dinic . I used ... // a,b,c.Ребро из вершины a в вершину b с пропускной способностью c 2 3 2 1 4 2 4 3 1 1 //исток 3 //сток Output data: 2

Checking the graph for planarity

Definition. Any graph that is homeomorphic to a planar graph is called planar. It is said that a graph admits flat stackin ... f it does not contain subgraphs that are homeomorphic to K5 or K3,3. Does anyone have examples of implementing this check?

incorrect answer on two tests of the problem about the size of the connectivity component in the graph. Search in depth

Task condition: An undirected unweighted graph is given. For it, you need to find the number of vertices that lie in the ... to the checking system CHADNT?(I've seen other implementations, but I wanted to find out what exactly is wrong with my code)

Search for subgraphs homeomorphic to K3, 3, and K5 Java

The Pontryagin - Kuratovsky theorem. A graph is planar if and only if it does not contain subgraphs that are homeomorphic to ... subGraph[4] = adjList[e]; } } } } return subGraph; }

How to check whether the graph is Eulerian, if so, then build an Eulerian cycle?

I know for sure that there is an Eulerian cycle in this graph. I don't understand how to check this and construct it using th ... ,0,0,0], # d [0,0,0,0,0,1,0,0], # e [0,0,1,0,0,0,1,1], # f [0,0,0,0,0,1,0,1], # g [0,0,0,0,0,1,1,0]] # h

Code optimization (Kruskal algorithm)

Task-implementation of the Kruskal algorithm for calculating the minimum total length of tracks in an amusement park. The ti ... et(i).y)); count++; } } System.out.printf("%.2f", MST(result, edges)); } }

Finding the smallest vertex cover in a tree

In one country called Infoland, there are n cities connected by two-way roads. A chain between cities a and b is a route betw ... G1 = child; K1 = vnuki; I = I1; int ver = get_independent_set(0); fout << n - ver; return 0; }

Search for all cycles in a directed graph by depth-first traversal

I wrote a program to search for all cycles in a directed graph and their number by depth-first search. The graph is defined b ... lt; p[k][1] << ' ' << endl; ncycle++; } color[v]=2; } } }

Plotting a graph with elements having more than one join

I can't immediately think of a way to describe a graph with nodes that must have more than one input. A normal directed gra ... ad this graph. After all, when traversing I will get a set of nodes, how do I understand that I am dealing with a transistor?