Group Abstract Group Abstract

Message Boards Message Boards

1
|
12.9K Views
|
3 Replies
|
6 Total Likes
View groups...
Share
Share this post:

Why Graph does not recognize chains of vertexes like NetGraph

Perfect logic:

NetGraph[{1, 1, 1}, {1 -> 2 -> 3}]

But this does not make sense:

Graph[{1, 1, 1}, {1 -> 2 -> 3}]

How can Rule behave differently when called by different functions?

3 Replies

Next time, if you cross-post, please links the posts together.

https://mathematica.stackexchange.com/questions/187113/why-graph-does-not-recognize-chains-of-vertexes-like-netgraph

To sum up the answers there, your notation considers 2->3 to be a vertex, connected to vertex 1. This notation cannot be made consistent without restrictions on what expressions can be vertices. NetGraph restricts vertices to integers and strings, so it can disambiguate such notation.

POSTED BY: Szabolcs Horvát
POSTED BY: Robert Jacobson
POSTED BY: Daniel Lichtblau
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard