Timeline for How can I generate a tailor-made directed graph from a given matrix
Current License: CC BY-SA 4.0
28 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Feb 16, 2021 at 1:20 | comment | added | Tugrul Temel | I will post here the link to the paper when published. Cok cok tesekkurler... | |
| Feb 16, 2021 at 0:44 | comment | added | kglr | @Tugrul Bey, thank you so much for the citation -- it is a great pleasure to know something I scribbled turned out to be useful. You can post a comment here when a link to the paper is available. | |
| Feb 15, 2021 at 17:46 | comment | added | Tugrul Temel | I submitted a short paper for publication, and footnote 4 on page 4 refers to your Code above. I hope the way I cited your contribution is fine with you. I wanted to send you a copy of the paper but I do not know how to send it. If you let me know, I will send you the paper. | |
| Jul 27, 2020 at 12:21 | comment | added | Tugrul Temel | Thanks so much for your prompt answer. | |
| Jul 27, 2020 at 0:38 | comment | added | kglr | @Tugrul you can try something like edges = {1 \[UndirectedEdge] 2, 2 \[UndirectedEdge] 3, 3 \[UndirectedEdge] 1}; estyles = {Red, Blue, Directive[Blue, Dashed]}; Legended[Graph[edges, EdgeStyle -> Thread[edges -> estyles]], Placed[LineLegend[estyles, edges, LegendLayout -> "Row"], Below]] | |
| Jul 26, 2020 at 18:54 | comment | added | Tugrul Temel | I tried to use PlotLegend in the above graphs with three types of lines: red, blue, and dashed blue. How can I place PlotLegendsbelow a graph (one of the above graphs with 3 edge types) to specify the types of edges? | |
| Dec 4, 2019 at 9:31 | history | edited | kglr | CC BY-SA 4.0 | added 18 characters in body |
| Dec 4, 2019 at 9:25 | comment | added | kglr | @TugrulTemel, right. | |
| Dec 4, 2019 at 0:11 | comment | added | Tugrul Temel | We use mat and Transpose[mat] as two inputs. If I want to use a totally different matrix mat1, for example, instead of Transpose[mat], should I simply replace Transpose[mat] in your code with mat1? | |
| Nov 29, 2019 at 14:16 | comment | added | Tugrul Temel | Thank you very much for letting me know the correct form, which is much simpler than my revision. | |
| Nov 28, 2019 at 23:54 | comment | added | kglr | I had a misplaced ]; the correct form is vc = Thread[vertices -> GraphEmbedding[GridGraph[{4, 5}]][[;; Length[vertices]]]]. | |
| Nov 28, 2019 at 13:26 | comment | added | Tugrul Temel | Your suggestion gave the same error; but then, I adjusted your suggestion using Drop[...] so as to make the vertices compatible with GridGraph size. vc = Thread[ vertices -> Drop[GraphEmbedding[GridGraph[{4, 5}]], -3][[;; Length[vertices]]]]; , which works fine now. I solved the problem with your guidance. Thank you. | |
| Nov 28, 2019 at 0:33 | comment | added | kglr | @Tugrul, maybe you can try vc = Thread[vertices -> GraphEmbedding[GridGraph[{4, 5}]]][[;;Length[vertices]]]? | |
| Nov 28, 2019 at 0:29 | comment | added | Tugrul Temel | In my original graph, I have 17 vertices and if I revise vc = Thread[vertices -> GraphEmbedding[GridGraph[{4, 4}]]]; it works with one less vertex. How do you revise GraphEmbedding if the number of vertices is odd? | |
| Nov 27, 2019 at 23:34 | comment | added | Tugrul Temel | Yes, you are right. I can now generate exactly the same output as you have above. This is really a very useful code for my research on "supply chains". Surely, I will refer to you for this contribution. Thanks again. | |
| Nov 27, 2019 at 23:22 | history | bounty awarded | Tugrul Temel | ||
| Nov 27, 2019 at 23:04 | comment | added | kglr | @Tugrul, I think it is because vertices is undefined. Fixed now. | |
| Nov 27, 2019 at 22:34 | history | edited | kglr | CC BY-SA 4.0 | added 107 characters in body |
| Nov 27, 2019 at 15:54 | comment | added | Tugrul Temel | I am not sure if the codes for the examples are bug free. They do not produce any graph nor give any error message. It simply declares the code itself as output. Any idea why this happens? | |
| Nov 27, 2019 at 9:28 | history | edited | kglr | CC BY-SA 4.0 | added 2421 characters in body |
| Nov 24, 2019 at 17:49 | comment | added | Tugrul Temel | I checked it with another example and found that the functiongrph[...] has a problem, possibly Associations is problematic. In my second example, directions of most edges using the original matrix (without transposing) are wrong, while the vertices selected are correct. | |
| Nov 24, 2019 at 17:01 | comment | added | Tugrul Temel | I checked all the cases (A, B, C, D). Except for case C, other graphs (number and direction of the edges) all are correct in your code. As mentioned earlier, in case of C with original matrix mat, the direction of edge from C to B in your code should be from B to C.This is the only contradiction I have. I should try the code with another example to see if the same contradiction remains. | |
| Nov 24, 2019 at 13:39 | comment | added | kglr | @TugrulTemel, re "edges appearing in both graphs", you can use complement = Complement[ EdgeList@grph[Transpose@mat, .25, "A", EdgeStyle -> Red], EdgeList@grph[mat, .25, "A"]]; intersection = Intersection[ EdgeList@grph[Transpose@mat, .25, "A", EdgeStyle -> Red], EdgeList@grph[mat, .25, "A"]]; SetProperty[EdgeAdd[grph[mat, .25, "A"], edgeadd], EdgeStyle -> {_ :> Blue, Alternatives @@ intersection -> Dashed, Alternatives @@ complement -> Red}]. Re direction of the edge b/w "C" and "B", it is more likely that I missed/misunderstood something. | |
| Nov 24, 2019 at 12:25 | comment | added | Tugrul Temel | When we combine two separate graphs, I lose track of the information on the edges that are present in both graphs. Would it possible to indicate with dashed lines those edges appearing in both graphs at the same time? | |
| Nov 24, 2019 at 2:10 | history | edited | kglr | CC BY-SA 4.0 | edited body |
| Nov 24, 2019 at 0:51 | comment | added | Tugrul Temel | Very very nice...Now I will try to digest your heavy code. Thanks a lot. | |
| Nov 24, 2019 at 0:45 | vote | accept | Tugrul Temel | ||
| Nov 24, 2019 at 0:28 | history | answered | kglr | CC BY-SA 4.0 |