How to find nodes that are in any cycle in a UNdirected graph? Announcing the arrival of...

Drawing spherical mirrors

An adverb for when you're not exaggerating

What is the meaning of 'breadth' in breadth first search?

Crossing US/Canada Border for less than 24 hours

Random body shuffle every night—can we still function?

AppleTVs create a chatty alternate WiFi network

preposition before coffee

Why does it sometimes sound good to play a grace note as a lead in to a note in a melody?

What order were files/directories output in dir?

What are the discoveries that have been possible with the rejection of positivism?

How does Belgium enforce obligatory attendance in elections?

1-probability to calculate two events in a row

How to compare two different files line by line in unix?

What is an "asse" in Elizabethan English?

What is the difference between a "ranged attack" and a "ranged weapon attack"?

Co-worker has annoying ringtone

Misunderstanding of Sylow theory

How many time has Arya actually used Needle?

Strange behavior of Object.defineProperty() in JavaScript

Amount of permutations on an NxNxN Rubik's Cube

How many morphisms from 1 to 1+1 can there be?

Is there hard evidence that the grant peer review system performs significantly better than random?

How to report t statistic from R

Why are vacuum tubes still used in amateur radios?



How to find nodes that are in any cycle in a UNdirected graph?



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)Easiest way to determine all disconnected sets from a graph?Checking if a graph is fully connectedCycle containing two given nodes in an undirected graphPrincipal EigenVector of an Adjacency matrix of an undirected graphProbability that a graph has more than one connected component?Comparison of Graphs (Adjecency List/Matrix)Finding connected components of the graphWhat is the minimum amount of information required to compute the number of edges in a subgraph of an arbitrary simple graph?Why repeated squaring and scaling a graph adjacency matrix yields a rank 1 projector?Can we argue that two graphs are isomorphic iff their adjacency matrices have the same eigenvalues?












0












$begingroup$


Let's say the adjacency matrix of a undirected graph $A$ is given by



$$A = begin{bmatrix}0
& 1& 0& 1 \ 1& 0& 1& 1 \ 0& 1& 0& 1 \ 1& 1& 1& 0end{bmatrix}$$



Then the nodes in any cycle are:



$$1 (1rightarrow2to3)\2 (2to3to4)$$



Is there a efficient way to get the list of nodes in any cycle?



I know summing up $A,A^2,A^3,A^4dots$ and searching up for non-zero diagonal works, but I am working on a high-dimensional matrix and it takes too long.



Thank you.



Solution from this theme does not work with undirected graph.










share|cite|improve this question











$endgroup$












  • $begingroup$
    Try Depth-First Search? I don't think adjacency matrices are great for finding cycles.
    $endgroup$
    – Don Thousand
    Mar 25 at 17:56












  • $begingroup$
    How use this procedure in matlab for my task? Could you give me some example?
    $endgroup$
    – Андрей Сологубов
    Mar 25 at 18:46










  • $begingroup$
    That is outside the confines of this stackexchange. Try searching for answers elsewhere.
    $endgroup$
    – Don Thousand
    Mar 25 at 18:47










  • $begingroup$
    I do not quite understand how using this algorithm, I can get a list of nodes in a loop.
    $endgroup$
    – Андрей Сологубов
    Mar 25 at 19:00










  • $begingroup$
    Ok, I understood about how the algorithm from the previous topic works. But I do not quite understand how I get the right path between two adjacent nodes. For example, there is a 1-2-3 circuit, but with the help of the shorttestpath command, I get 1-2, not 1-2-3. It is clear that this is really the shortest distance, but I want to get a contour - how to do it?
    $endgroup$
    – Андрей Сологубов
    Mar 25 at 19:33
















0












$begingroup$


Let's say the adjacency matrix of a undirected graph $A$ is given by



$$A = begin{bmatrix}0
& 1& 0& 1 \ 1& 0& 1& 1 \ 0& 1& 0& 1 \ 1& 1& 1& 0end{bmatrix}$$



Then the nodes in any cycle are:



$$1 (1rightarrow2to3)\2 (2to3to4)$$



Is there a efficient way to get the list of nodes in any cycle?



I know summing up $A,A^2,A^3,A^4dots$ and searching up for non-zero diagonal works, but I am working on a high-dimensional matrix and it takes too long.



Thank you.



Solution from this theme does not work with undirected graph.










share|cite|improve this question











$endgroup$












  • $begingroup$
    Try Depth-First Search? I don't think adjacency matrices are great for finding cycles.
    $endgroup$
    – Don Thousand
    Mar 25 at 17:56












  • $begingroup$
    How use this procedure in matlab for my task? Could you give me some example?
    $endgroup$
    – Андрей Сологубов
    Mar 25 at 18:46










  • $begingroup$
    That is outside the confines of this stackexchange. Try searching for answers elsewhere.
    $endgroup$
    – Don Thousand
    Mar 25 at 18:47










  • $begingroup$
    I do not quite understand how using this algorithm, I can get a list of nodes in a loop.
    $endgroup$
    – Андрей Сологубов
    Mar 25 at 19:00










  • $begingroup$
    Ok, I understood about how the algorithm from the previous topic works. But I do not quite understand how I get the right path between two adjacent nodes. For example, there is a 1-2-3 circuit, but with the help of the shorttestpath command, I get 1-2, not 1-2-3. It is clear that this is really the shortest distance, but I want to get a contour - how to do it?
    $endgroup$
    – Андрей Сологубов
    Mar 25 at 19:33














0












0








0





$begingroup$


Let's say the adjacency matrix of a undirected graph $A$ is given by



$$A = begin{bmatrix}0
& 1& 0& 1 \ 1& 0& 1& 1 \ 0& 1& 0& 1 \ 1& 1& 1& 0end{bmatrix}$$



Then the nodes in any cycle are:



$$1 (1rightarrow2to3)\2 (2to3to4)$$



Is there a efficient way to get the list of nodes in any cycle?



I know summing up $A,A^2,A^3,A^4dots$ and searching up for non-zero diagonal works, but I am working on a high-dimensional matrix and it takes too long.



Thank you.



Solution from this theme does not work with undirected graph.










share|cite|improve this question











$endgroup$




Let's say the adjacency matrix of a undirected graph $A$ is given by



$$A = begin{bmatrix}0
& 1& 0& 1 \ 1& 0& 1& 1 \ 0& 1& 0& 1 \ 1& 1& 1& 0end{bmatrix}$$



Then the nodes in any cycle are:



$$1 (1rightarrow2to3)\2 (2to3to4)$$



Is there a efficient way to get the list of nodes in any cycle?



I know summing up $A,A^2,A^3,A^4dots$ and searching up for non-zero diagonal works, but I am working on a high-dimensional matrix and it takes too long.



Thank you.



Solution from this theme does not work with undirected graph.







graph-theory matlab cyclic-groups






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Mar 25 at 18:30









Brian

1,499416




1,499416










asked Mar 25 at 17:22









Андрей СологубовАндрей Сологубов

12




12












  • $begingroup$
    Try Depth-First Search? I don't think adjacency matrices are great for finding cycles.
    $endgroup$
    – Don Thousand
    Mar 25 at 17:56












  • $begingroup$
    How use this procedure in matlab for my task? Could you give me some example?
    $endgroup$
    – Андрей Сологубов
    Mar 25 at 18:46










  • $begingroup$
    That is outside the confines of this stackexchange. Try searching for answers elsewhere.
    $endgroup$
    – Don Thousand
    Mar 25 at 18:47










  • $begingroup$
    I do not quite understand how using this algorithm, I can get a list of nodes in a loop.
    $endgroup$
    – Андрей Сологубов
    Mar 25 at 19:00










  • $begingroup$
    Ok, I understood about how the algorithm from the previous topic works. But I do not quite understand how I get the right path between two adjacent nodes. For example, there is a 1-2-3 circuit, but with the help of the shorttestpath command, I get 1-2, not 1-2-3. It is clear that this is really the shortest distance, but I want to get a contour - how to do it?
    $endgroup$
    – Андрей Сологубов
    Mar 25 at 19:33


















  • $begingroup$
    Try Depth-First Search? I don't think adjacency matrices are great for finding cycles.
    $endgroup$
    – Don Thousand
    Mar 25 at 17:56












  • $begingroup$
    How use this procedure in matlab for my task? Could you give me some example?
    $endgroup$
    – Андрей Сологубов
    Mar 25 at 18:46










  • $begingroup$
    That is outside the confines of this stackexchange. Try searching for answers elsewhere.
    $endgroup$
    – Don Thousand
    Mar 25 at 18:47










  • $begingroup$
    I do not quite understand how using this algorithm, I can get a list of nodes in a loop.
    $endgroup$
    – Андрей Сологубов
    Mar 25 at 19:00










  • $begingroup$
    Ok, I understood about how the algorithm from the previous topic works. But I do not quite understand how I get the right path between two adjacent nodes. For example, there is a 1-2-3 circuit, but with the help of the shorttestpath command, I get 1-2, not 1-2-3. It is clear that this is really the shortest distance, but I want to get a contour - how to do it?
    $endgroup$
    – Андрей Сологубов
    Mar 25 at 19:33
















$begingroup$
Try Depth-First Search? I don't think adjacency matrices are great for finding cycles.
$endgroup$
– Don Thousand
Mar 25 at 17:56






$begingroup$
Try Depth-First Search? I don't think adjacency matrices are great for finding cycles.
$endgroup$
– Don Thousand
Mar 25 at 17:56














$begingroup$
How use this procedure in matlab for my task? Could you give me some example?
$endgroup$
– Андрей Сологубов
Mar 25 at 18:46




$begingroup$
How use this procedure in matlab for my task? Could you give me some example?
$endgroup$
– Андрей Сологубов
Mar 25 at 18:46












$begingroup$
That is outside the confines of this stackexchange. Try searching for answers elsewhere.
$endgroup$
– Don Thousand
Mar 25 at 18:47




$begingroup$
That is outside the confines of this stackexchange. Try searching for answers elsewhere.
$endgroup$
– Don Thousand
Mar 25 at 18:47












$begingroup$
I do not quite understand how using this algorithm, I can get a list of nodes in a loop.
$endgroup$
– Андрей Сологубов
Mar 25 at 19:00




$begingroup$
I do not quite understand how using this algorithm, I can get a list of nodes in a loop.
$endgroup$
– Андрей Сологубов
Mar 25 at 19:00












$begingroup$
Ok, I understood about how the algorithm from the previous topic works. But I do not quite understand how I get the right path between two adjacent nodes. For example, there is a 1-2-3 circuit, but with the help of the shorttestpath command, I get 1-2, not 1-2-3. It is clear that this is really the shortest distance, but I want to get a contour - how to do it?
$endgroup$
– Андрей Сологубов
Mar 25 at 19:33




$begingroup$
Ok, I understood about how the algorithm from the previous topic works. But I do not quite understand how I get the right path between two adjacent nodes. For example, there is a 1-2-3 circuit, but with the help of the shorttestpath command, I get 1-2, not 1-2-3. It is clear that this is really the shortest distance, but I want to get a contour - how to do it?
$endgroup$
– Андрей Сологубов
Mar 25 at 19:33










0






active

oldest

votes












Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "69"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3162088%2fhow-to-find-nodes-that-are-in-any-cycle-in-a-undirected-graph%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Mathematics Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


Use MathJax to format equations. MathJax reference.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3162088%2fhow-to-find-nodes-that-are-in-any-cycle-in-a-undirected-graph%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Magento 2 - Add success message with knockout Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?Success / Error message on ajax request$.widget is not a function when loading a homepage after add custom jQuery on custom themeHow can bind jQuery to current document in Magento 2 When template load by ajaxRedirect page using plugin in Magento 2Magento 2 - Update quantity and totals of cart page without page reload?Magento 2: Quote data not loaded on knockout checkoutMagento 2 : I need to change add to cart success message after adding product into cart through pluginMagento 2.2.5 How to add additional products to cart from new checkout step?Magento 2 Add error/success message with knockoutCan't validate Post Code on checkout page

Fil:Tokke komm.svg

Where did Arya get these scars? Unicorn Meta Zoo #1: Why another podcast? Announcing the arrival of Valued Associate #679: Cesar Manara Favourite questions and answers from the 1st quarter of 2019Why did Arya refuse to end it?Has the pronunciation of Arya Stark's name changed?Has Arya forgiven people?Why did Arya Stark lose her vision?Why can Arya still use the faces?Has the Narrow Sea become narrower?Does Arya Stark know how to make poisons outside of the House of Black and White?Why did Nymeria leave Arya?Why did Arya not kill the Lannister soldiers she encountered in the Riverlands?What is the current canonical age of Sansa, Bran and Arya Stark?