Questions tagged [undirected-graph]

An undirected graph has edges which have no orientation. It is a mathematical concept.

Definition of an undirected graph.

271 questions
0
votes
2 answers

Searching for a minimum cycle in a graph containing a set of nodes

If i have an undirected weighted graph G = (V, e) and a set of nodes P, how do i find the minimum cycle containing all the nodes in P? I have a large graph G and a set of nodes P based on user input. After I get the user input i want to find the…
0
votes
0 answers

Determining if graph is a tree data structure?

Problem I'm dealing with is pretty straightforward. Need to get simple true or false from a function. My business domain with classes looks like this: A / \ …
Wrapper
  • 794
  • 10
  • 25
0
votes
1 answer

algorithm to Find connected components in a graph and to which connected components each node does it belong

I have an undirected graph and looking for (efficient) algorithm that determine how many connected components there is in the and for every node it could tell in which connected components it locate. I think it might be the Depth-First Search but…
0
votes
0 answers

Count cycles in undirected graph that does not share a vertex

I am trying to understand an algorithm to count the number of isolated cycles in a graph. By isolated, I mean the cycles that do not share any vertex. Here is an example: Here, 1-2-4-1 and 3-6-5-3 are the two cycles that do not share any vertex.…
0
votes
0 answers

Get results with undirected graph but not with multidigraph

Dear people of stackoverflow, I made a routeplanner based on length and elevation. With both costfactors I get only results with an undirected graph. So the code is good for an undirect graph but doesn't work with a MultiDiGraph as input, which I…
0
votes
1 answer

How to create undirected (i)graph in R for protein-interaction data with tissue information?

I am new to bioinformatics in general and would really appreciate some help and tips with the project Im working on. My data of protein-protein interactions is stored in a table (in MySQL) with binary information about tissue-specificity. Now I am…
0
votes
1 answer

Graph Homomorphism using Python

My idea is to write a python program which would take as arguments two finite simple undirected graphs say G,H and returns the number hom(G,H) of graph homomorphisms from G to H. Examples: If G=K_1 (one-vertex graph) then hom(G,H) equals the number…
Jeff
  • 23
  • 2
0
votes
3 answers

How are ancestors and descendants defined in an undirected graph?

I found this definition of an ancestor and this definition of a descendant. They look meaningful, but unfortunately only for rooted trees. Also I found an informal definition for DAGs. However, what I'm interested in is the FORMAL DEFINITION of…
vdshk
  • 1
  • 3
0
votes
0 answers

How to find shortest path between one source and all the remaining vertices?

I use the function g.get_shortest_paths(vertex_index) to get all shortest paths between one source vertex_index and all the remaining vertice, but this function doesn't take the constraint on the returned path. I have a graph G and a set of vertices…
0
votes
1 answer

Using GDS to make a neo4j undirected graph

The neo4j Graph Data Science (GDS) "Triangle Count" algorithm only runs on an undirected graph. I can convert my existing directed graph to undirected for the calculation using: CALL gds.graph.create('myGraph3', '*', {BELONGS_TO: {orientation:…
e25548
  • 13
  • 5
0
votes
0 answers

How to get path-count from source to destination in Un-directed Graph (Non-zero based)?

I've tried the below code to find possible paths count in an undirected Graph.? But it gave me an error. If I tried with the commented section it works fine. If it supported only for zero-index-based structure, then what is the alternative approach…
Priyanka
  • 341
  • 3
  • 13
0
votes
1 answer

How to change color of nodes in networkx graph based on graph's modularity

Currently, i have a NetworkX graph that changes color and size of nodes based on degree centrality, but I am looking to instead of changing color based on degree centrality, I am looking to change the color of the nodes based on modularity,…
0
votes
0 answers

Finding a cycle in undirected graph using DFS in python

So, I'm trying to solve a task where I'm supposed to find if there is a cycle in the given graph using DFS. So what im strugguling with now is to match the nodes, since they are of type string I'm having some truble. The error message iI'm getting…
0
votes
2 answers

Finding k-coloring (with k = 2/3) graph in linear time

Question: Given a graph G = (V,E) a k-coloring of G is a labeling of the vertices with the colors c_1, c_2, ..., c_k such that for every edge (u,v) the color of u is different from the color of v. A. Give a linear time algorithm that finds a…
0
votes
0 answers

Fit undirected Bayesian Network with bnlearn

I learnt Bayesian Network (BN) structures with the bnlearn package in R. However, for some of my BN, I have undirected edges. Thus, when I want to fit the BN (i.e. learn the Conditional Probability Tables = CPT), I obtain this error message telling…
FrsLry
  • 348
  • 4
  • 19