Graphviz 13.0.0~dev.20241220.2304
Loading...
Searching...
No Matches
acyclic.c File Reference

make directed graph acyclic, implements graphviz_acyclic, used in cmd/tools/acyclic.c More...

#include <cgraph/cghdr.h>
#include <stdbool.h>
#include <stddef.h>
Include dependency graph for acyclic.c:

Go to the source code of this file.

Data Structures

struct  Agnodeinfo_t
 

Macros

#define ND_mark(n)   (((Agnodeinfo_t *)((n)->base.data))->mark)
 
#define ND_onstack(n)   (((Agnodeinfo_t *)((n)->base.data))->onstack)
 
#define graphName(g)   (agnameof(g))
 

Functions

static void addRevEdge (Agraph_t *g, Agedge_t *e)
 
static bool dfs (Agraph_t *g, Agnode_t *t, bool hasCycle, size_t *num_rev)
 Return true if the graph has a cycle.
 
bool graphviz_acyclic (Agraph_t *g, const graphviz_acyclic_options_t *opts, size_t *num_rev)
 

Detailed Description

Copyright (c) 2011 AT&T Intellectual Property All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at https://www.eclipse.org/legal/epl-v10.html

Authors: Stephen North, Emden Gansner Contributors: Details at https://graphviz.org

Definition in file acyclic.c.

Macro Definition Documentation

◆ graphName

#define graphName (   g)    (agnameof(g))

Definition at line 30 of file acyclic.c.

◆ ND_mark

#define ND_mark (   n)    (((Agnodeinfo_t *)((n)->base.data))->mark)

Definition at line 28 of file acyclic.c.

◆ ND_onstack

#define ND_onstack (   n)    (((Agnodeinfo_t *)((n)->base.data))->onstack)

Definition at line 29 of file acyclic.c.

Function Documentation

◆ addRevEdge()

static void addRevEdge ( Agraph_t g,
Agedge_t e 
)
static

Definition at line 37 of file acyclic.c.

References agattr(), agcopyattr(), AGEDGE, agedge(), aghead, agnameof(), agsafeset(), agtail, agxget(), HEADPORT_ID, and TAILPORT_ID.

Referenced by dfs().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dfs()

static bool dfs ( Agraph_t g,
Agnode_t t,
bool  hasCycle,
size_t *  num_rev 
)
static

Definition at line 52 of file acyclic.c.

References addRevEdge(), agdelete(), agedge(), agfstout(), aghead, agisstrict(), agnameof(), agnxtout(), agtail, dfs(), ND_mark, and ND_onstack.

Referenced by acyclic(), dfs(), dfs(), and graphviz_acyclic().

Here is the call graph for this function:
Here is the caller graph for this function: