I have two isomorphic graphs.
Given a self-complementary graph G, is there any faster algorithm to find the vertex mapping between G and its complement?
I'm thinking there should be a faster way because we know that the 2 graphs are both isomorphic and complementary.
EDIT
Sorry I shoudld've been more clear:
I already know of the VF2 algorithm which has time complexity of O(V^2) in the best case and O(V!·V) in the worst case. Which makes it slow to compute mappings for the large graphs (1k vertices, 500k edges) that I'm working with.
I was just asking if given this special case of the graphs being both isomorphic and complementary there exists a faster solution.
This is the isomorphism problem for self-complementary graphs.
It might be expected
that
the isomorphism
problem
would
in fact be easier
to tackle when
restricted
to self-complementary
graphs
or digraphs,
because
of their
strong
structural
properties.
It turns
out,
however [Colbourn
and
Colbourn
1978,
1979],
that
the isomorphism
problem
for self-complimentary graphs
is polynomially
equivalent to the general
isomorphism
problem;
we say that
it is
isomorphism
complete
. Even if we just want to know whether
a graph
or digraph
is self-complementary, the complexity is the same.
This
makes it improbable
that
there
will be any simple
and
quick test
for recognising
sc-graphs;
for
example,
comparing
the chromatic
polynomial
of a graph
with
that
of its
complement will not tell us whether
it is self-complementary
(see
1.59).
Recognition
and isomorphism
of self-complementary
graphs
therefore
take
on added
importance.
They
could
provide
a cure
for what
has been nicknamed
the isomorphism
disease,
and
even settle
the famous
(or notorious)
question
of whether
P is equal
to NP, as we shall
see.
p.97 of this article:
Self-complementary graphs and generalisations: a comprehensive reference manual.
Alastair Farrugia
University of Malta
August 1999
http://www.alastairfarrugia.net/sc-graph/sc-graph-survey.pdf
Related
I'm not sure if I'm using the right term here, but for fully connected components I mean there's an (undirected) edge between every pair of vertices in a component, and no additional vertices can be included without breaking this property.
There're a number algorithms for finding strongly connected components in a graph though (for example Tarjan's algorithm), is there an algorithm for finding such "fully connected components"?
What you are looking for is a list of all the maximal cliques of the graph. It's also called the clique problem. No known polynomial time solution exists for a generic undirected graph.
Most versions of the clique problem are hard. The clique decision problem is NP-complete (one of Karp's 21 NP-complete problems). The problem of finding the maximum clique is both fixed-parameter intractable and hard to approximate. And, listing all maximal cliques may require exponential time as there exist graphs with exponentially many maximal cliques. Therefore, much of the theory about the clique problem is devoted to identifying special types of graph that admit more efficient algorithms, or to establishing the computational difficulty of the general problem in various models of computation.
-https://en.wikipedia.org/wiki/Clique_problem
I was also looking at the same question.
https://en.wikipedia.org/wiki/Bron-Kerbosch_algorithm This turns out to be an algorithm to list it, however, it's not fast. If your graph is sparse, you may want to use the vertex ordering version of the algorithm:
For sparse graphs, tighter bounds are possible. In particular the vertex-ordering version of the Bron–Kerbosch algorithm can be made to run in time O(dn3d/3), where d is the degeneracy of the graph, a measure of its sparseness. There exist d-degenerate graphs for which the total number of maximal cliques is (n − d)3d/3, so this bound is close to tight.[6]
I was searching for graph coloring algorithms, and I have found algorithm, which, how author states, runs in polynomial time.
Author gives also C++ program source code and demonstration program.
The suspicious thing is that decision problem whether graph is k-colorable, is NP-complete, so no polynomial time algorithm should exist until P=NP.
However, author doesn't claims, that algorithm works for all graphs, he only says, that he haven't found any graph, for which algorithm doesn't work.
So, the question: does that algorithm really works for every graph and that means actually P=NP, or there exist certain graphs/graph classes for which it doesn't work? Or maybe there is simply a mistake in complexity calculation?
I think you haven't read the abstract very carefully.
The author presents an algorithm which finds m-colorings of a graph, for some m less than the limit imposed by Brooks' theorem: https://en.wikipedia.org/wiki/Brooks'_theorem
(which is old and states that chi < delta + 1 as the author states in second sentence.)
The author is aware of the P vs NP question. The paper does not claim to resolve the question, he merely states:
For all known examples of graphs, the algorithm finds a proper m-coloring of the vertices of the graph G for m equal to the chromatic number χ(G)
Then he asks,
In view of the importance of the P versus NP question, we ask: does there exist a graph G for which this algorithm cannot find a proper m-coloring of the vertices of G with m equal to the chromatic number χ(G)?
Emphasis in original (!)
So it doesn't claim to resolve P vs NP, its just, as a matter of academic research, they ask "can anyone produce an example on which this algorithm fails to reach the chromatic number", which might be instructive to them for mathematical purposes. It is highly unlikely that the algorithm actually achieves the chromatic number for all graphs. (Although it is, scientifically speaking, unknown whether it does or doesn't.)
Is there an efficient algorithm to find the subgraph with the largest average degree (which may be the graph itself)?
The paper "Finding a Maximum-Density Subgraph" by Andrew Goldberg gives a polynomial-time algorithm for identifying such a graph. It looks like the algorithm makes logarithmically many calls to a max-flow algorithm on appropriately constructed graphs. From what I've read, it looks like the algorithm is just a binary search over the average degree where each guess is checked using a maximum flow on a standard graph construction. Most of the complexity appears to be in arguing why the construction is correct.
Hope this helps!
I have a main graph and another small graph, suppose that the small graph could be repeated in the main graph as a subgraph with a degree of similarity(not necessarily the same small graph)
What's a good algorithm (or Java library) to find them all?
I think you are trying to solve the Subgraph Isomorphism Problem which is known to be NP-complete. That means, there is likely no fast algorithm to do what you need. Your requirement of similarity (and not only isomorphism) only adds another complexity.
The Wikipedia page talks about Ulmann's algorithm that solves this problem in polynomial time (fast) for certain classes of graphs, you might give it a try.
What are the efficient algorithms for finding a vertex tour in a weighted undirected graph with maximum cost if we need to start from a particular vertex?
It's NPC because if you set weights as 1 for all edges, if HC exists it will be your answer, and so In all you can find HC existence from a single source which is NPC by solving this problem so your problem is NPC, but there are some polynomial approximation algorithms.
Since the problem is NP-hard, you are very unlikely to find an efficient algorithm that solves the problem exactly for all possible weighted input graphs.
However, there might be efficient algorithms that are guaranteed to find an answer that is at most a constant times away from the best possible answer, e.g. there might be an efficient algorithm that is guaranteed to find a path that has weight at least 1/2 of the maximum weight path.
If you are interested in searching for such algorithms, you could try Google searches for "weighted hamiltonian path approximation algorithm", which is close to, but not identical to, your problem. It is not the same because Hamiltonian paths are required to include all vertexes. Here is one research paper that might either contain, or have ideas that lead to, an approximation algorithm for your problem:
http://portal.acm.org/citation.cfm?id=139404.139468
"A general approximation technique for constrained forest problems" by Michel X. Goemans and David P. Williams.
Of course, if your graphs are small enough that you can enumerate all possible paths containing your desired vertex "fast enough for your purposes", then you can solve it exactly.