Questions tagged [graphs]

Questions about graphs, discrete structures of nodes which are connected by edges, including trees and graphs with weighted edges.

Questions about graphs, discrete structures of nodes which are connected by edges. Popular flavors are trees and networks with edge capacity.

4895 questions
39
votes
14 answers

What are some real world applications of graphs?

Can you give some real world examples of what graphs algorithms people are actually using in applications? Given a complicated graphs, say social networks, what properties/quantity people want to know about them? —- It would be great if you can give…
NonalcoholicBeer
  • 568
  • 1
  • 4
  • 11
14
votes
2 answers

Why we do isomorphism, automorphism and homomorphism?

What are the key differences between these three terms isomorphism, automorphism and homomorphism in simple layman language and why we do isomorphism, automorphism and homomorphism ?
Xara
  • 351
  • 3
  • 11
13
votes
1 answer

Research in Graph Theory versus Graph Algorithms

I have a very generic question to ask. It is related to research. I'm interested in Graph theory. I have done a course in it. I have done some topics related to both graph theory as a point of view of doing it as a mathematics student and also…
legendkiller
  • 131
  • 1
  • 3
10
votes
0 answers

Constructing a connected graph with given degree sequence

I am interested in constructing simple connected graphs where each vertex has a fixed number of edges (degree) ahead of time. I had originally assume I could use some modification of the Havel-Hakimi algorithm to do this, but Havel-Hakimi isn't…
Eric J
  • 211
  • 1
  • 3
9
votes
1 answer

About graphs whose edge set decomposes into perfect matchings

Is there a characterization of graphs whose edge set decomposes into a disjoint union of perfect matchings? One trivial class of such graphs are $d$-regular $(n,n)$-bipartite graphs. Their edge set will decompose into $d$ disjoint perfect…
user6818
  • 1,135
  • 8
  • 13
8
votes
0 answers

Problem with manipulation of colored graph

Consider a finite set of colors and a given an unweighted graph with the following properties: 1) Graph is connected. 2) All vertices of the graph has a color in the given set of colors. 3) No two adjacent vertices have the same color. Define a flip…
vda8888
  • 181
  • 2
8
votes
2 answers

shortest distance vs shortest path

This question might be redundant but I want to verify my understanding further. Suppose I have this linear directed graph: $$S \overset{2}{\to} A \overset{1}{\to} B \overset{3}{\to} E \overset{1}\to D.$$ Here, $S$ is the source, $D$ is the target,…
Jake Marry
  • 183
  • 3
8
votes
6 answers

Every simple undirected graph with more than $(n-1)(n-2)/2$ edges is connected

If a graph with $n$ vertices has more than $\frac{(n-1)(n-2)}{2}$ edges then it is connected. I am a bit confused about this question, since I can always prove that for a graph to connected you need more than $|E|>n-1$ edges.
user1675999
  • 1,027
  • 6
  • 15
  • 23
8
votes
2 answers

Number of descendants of each node in a DAG

1) Is there a better algorithm than the naive O(|E|.|V|) to compute the number of descendants of each vertex in a DAG? 2) Is there an online algorithm to do so, assuming that nodes are added one by one and connect to a non empty subset of the…
Arthur B
  • 353
  • 2
  • 8
8
votes
2 answers

Find a path from s to t using as few red nodes as possible

Was doing a little interview prep. Given an undirected graph G, such that each node is colored red or blue and |E|≥|V|, find a path in O(|E|) time such that starting and ending at 2 blue nodes, s and t, that you pass through as few red nodes as…
halfquarter
  • 115
  • 5
7
votes
1 answer

Is there a non-brute force algorithm for Eulerization of graphs?

Given some undirected, unweighted, connected, and potentially parallel-edged graph $G$, an Euler circuit may be constructed iff every vertex in $G$ has an even degree. In graphs with two or more vertices of odd degree (there may only be multiples of…
VF1
  • 317
  • 1
  • 14
7
votes
2 answers

How to remove cycles from a directed graph

I saw this from SO which led to Feedback Arc Set, which describes the problem nicely: In graph theory, a directed graph may contain directed cycles, a one-way loop of edges. In some applications, such cycles are undesirable, and we wish to…
Lance
  • 2,213
  • 1
  • 17
  • 31
7
votes
2 answers

How many edges must a graph with N vertices have in order to guarantee that it is connected?

Possible Duplicate: Every simple undirected graph with more than $(n-1)(n-2)/2$ edges is connected At lesson my teacher said that a graph with $n$ vertices to be certainly connected should have $ {\frac{n(n-1)}{2}+1 \space }$ edges showing that…
abc
  • 1,625
  • 2
  • 12
  • 22
7
votes
2 answers

Is Directed Graph a Graph?

I came across an issue with the definition of a (directed) graph in Sipser's Introduction to the theory of computation, 2nd Ed. On pp.10, An undirected graph, or simply a graph, is a set of points with lines connecting some of the points. The points…
Nobody
  • 430
  • 1
  • 5
  • 19
7
votes
1 answer

Edge contraction in DAG

I have a directed acyclic graph whose vertices are either red or black. I want to perform edge contraction between pairs of red vertices only, and avoid introducing cycles. The goal is to have the fewest number of red vertices remaining (and no…
Rob
  • 171
  • 5
1
2 3
28 29