JamesK

15 Reputation

5 Badges

9 years, 207 days

MaplePrimes Activity


These are questions asked by JamesK

I'm trying to add the output of my function FunctionToTree,which gets all elements from an expression, to a graph using the Graph function but I'm getting erros even when I add it as a list.

with(GraphTheory):
with(SpecialGraphs):
FunctionToTree:=proc(expr)
local elem;
local Tree:=NULL;
local exprType := convert(whattype(expr),string);
local newExpr:=convert(expr,string);
if (nops(expr) <> 1) or (nops(op(1,expr)) <> 1) then
for elem in op(expr) do :


Is there any way to convert the output of ToInert to a graph/tree representation?
ToInert's output type is a function and I've tried converting it to an expression  first but didn’t succeed. I've also looked for functions in the GraphTheory package that could help in this process but didn’t manage to find anything useful.
Thank you.

I'm looking to create a procedure,Inside:=proc(expr), in maple that takes an expression and will return a direct graph of all the elements,including the operands,of that expression.

For instance for x+2*y*z^2 the output should be (in a graph form not a tree)

                           +
        ...

Page 1 of 1