Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #9409 > unrolled thread
| Started by | dan jack <dan.spectrix@gmail.com> |
|---|---|
| First post | 2012-04-04 08:27 +0000 |
| Last post | 2012-04-07 09:55 +0000 |
| Articles | 3 — 3 participants |
Back to article view | Back to comp.soft-sys.math.mathematica
subgraph error (errata) dan jack <dan.spectrix@gmail.com> - 2012-04-04 08:27 +0000
Re: subgraph error (errata) Murta <rodrigomurtax@gmail.com> - 2012-04-05 09:57 +0000
Re: subgraph error (errata) David Bailey <dave@removedbailey.co.uk> - 2012-04-07 09:55 +0000
| From | dan jack <dan.spectrix@gmail.com> |
|---|---|
| Date | 2012-04-04 08:27 +0000 |
| Subject | subgraph error (errata) |
| Message-ID | <jlh0l6$t5s$1@smc.vnet.net> |
I write an errata for the previous message:
I obtain the error in this case:
gg = Graph[{11 -> 2, 11 -> 3, 4 -> 11, 5-> 11, 11 -> 11}]
Subgraph[gg, 1 ->_ ]
Join::headsd: Expression {11,2} at position 1 is expected to have head
List for all subexpressions through level 11.
DeleteDuplicates::list: List expected at position 1 in
DeleteDuplicates[Join[{11,2},{11,3},11]].
but not in this case:
gg = Graph[{1 -> 2, 1 -> 3, 4 -> 1, 5-> 1, 1-> 1}]
so it seems that the only difference is the vertex number: 1 works but
11 do not works ...very strange.
Obviously the arrows are the correct Directed Edges (ESC de ESC)...
any help or solidarity comment is appreciated :-)
[toc] | [next] | [standalone]
| From | Murta <rodrigomurtax@gmail.com> |
|---|---|
| Date | 2012-04-05 09:57 +0000 |
| Message-ID | <jljq9m$d15$1@smc.vnet.net> |
| In reply to | #9409 |
On Apr 4, 5:27 am, dan jack <dan.spect...@gmail.com> wrote:
> I write an errata for the previous message:
>
> I obtain the error in this case:
>
> gg = Graph[{11 -> 2, 11 -> 3, 4 -> 11, 5-> 11, 11 -> 11}]
> Subgraph[gg, 1 ->_ ]
>
> Join::headsd: Expression {11,2} at position 1 is expected to have head
> List for all subexpressions through level 11.
> DeleteDuplicates::list: List expected at position 1 in
> DeleteDuplicates[Join[{11,2},{11,3},11]].
>
> but not in this case:
> gg = Graph[{1 -> 2, 1 -> 3, 4 -> 1, 5-> 1, 1-> 1}]
>
> so it seems that the only difference is the vertex number: 1 works but
> 11 do not works ...very strange.
>
> Obviously the arrows are the correct Directed Edges (ESC de ESC)...
>
> any help or solidarity comment is appreciated :-)
Very anoying!.. Just Wolfram Team to see that.
I get intriged and made this test:
sub[n_]:=Module[{gg=Graph[{n\[DirectedEdge]2,n\[DirectedEdge]3,4\
[DirectedEdge]n,5\[DirectedEdge]n,n\[DirectedEdge]n}]},
HighlightGraph[gg,Subgraph[gg,n\[DirectedEdge]_]]]
sub[1] works and all others get error...
Let's see another answers.
best regards
Murta
[toc] | [prev] | [next] | [standalone]
| From | David Bailey <dave@removedbailey.co.uk> |
|---|---|
| Date | 2012-04-07 09:55 +0000 |
| Message-ID | <jlp2tl$126$1@smc.vnet.net> |
| In reply to | #9409 |
On 04/04/2012 09:27, dan jack wrote:
> I write an errata for the previous message:
>
> I obtain the error in this case:
>
> gg = Graph[{11 -> 2, 11 -> 3, 4 -> 11, 5-> 11, 11 -> 11}]
> Subgraph[gg, 1 ->_ ]
>
> Join::headsd: Expression {11,2} at position 1 is expected to have head
> List for all subexpressions through level 11.
> DeleteDuplicates::list: List expected at position 1 in
> DeleteDuplicates[Join[{11,2},{11,3},11]].
>
> but not in this case:
> gg = Graph[{1 -> 2, 1 -> 3, 4 -> 1, 5-> 1, 1-> 1}]
>
> so it seems that the only difference is the vertex number: 1 works but
> 11 do not works ...very strange.
>
> Obviously the arrows are the correct Directed Edges (ESC de ESC)...
>
> any help or solidarity comment is appreciated :-)
>
I think when you specify a subgraph using a pattern, you have to specify
edges using the DirectedEdge construct. This actually prints rather like
-> but there is a little blob at the left end (confusing eh?)
Thus the correct syntax is:
gr = Graph[{1 -> 2, 1 -> 3, 4 -> 1, 5 -> 1, 1 -> 1}]
Subgraph[gr, DirectedEdge[1, _]]
David Bailey
http://www.dbaileyconsultancy.co.uk
[toc] | [prev] | [standalone]
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web