Sponsored links: Algebra eBooks
 

Help Index

A

B

C

D

E

F

G

H

I

J

K

L

M

N

O

P

Q

R

S

T

U

V

W

X

Y

Z

The Maxima on-line user's manual

Algebra Calculator

Search:

Slength

Function: slength (<string>) Returns the number of characters in <string>.

load(graphs);
A : create_graph(10, [[0, 2], [1, 2], [1, 3], [2, 3], [3, 4], [4, 5], [4, 9], [7, 6], [6, 5], [8, 7], [7, 5], [9, 8]]);
G(s) := (z : A, s : string(s), n : slength(s), for i from 1 thru n do (z : graph_union(z,A), remove_edge([10*i - 1, 10*i - 2], z), if charat(s,i)="1" then add_edges([[10*i-2,10*i],[10*i-1,10*i+1],[10*i-1,10*i+6]],z) else add_edges([[10*i-1,10*i],[10*i-2,10*i+1],[10*i-1,10*i+6]],z)), z);
draw_graph(G(100),show_id=true);

(%o1)                                true
(%i2) 

Related Examples